The Source for Java Technology Collaboration

Home » java.net Forums » Java Deployment & Distribution » Java Plug-in

Thread: Is there a file that can be edited that can change the JVM parameters

Welcome, Guest Help
Login Login
Guest Settings Guest Settings
This question is answered. Helpful answers available: 2. Correct answers available: 1.

Reply to this Thread Reply to this Thread Search Forum Search Forum Back to Thread List Back to Thread List

Permlink Replies: 23 - Last Post: Aug 14, 2008 8:41 PM by: demonduck Threads: [ Previous | Next ]
demonduck

Posts: 382
Is there a file that can be edited that can change the JVM parameters
Posted: Jul 25, 2008 1:14 AM
 
  Click to reply to this thread Reply

Is there a file that can be edited to change the JVM parameters? I'm thinking about writing a little GUI to help people set the JVM parameters on their machine.

The way it is now is daunting to many people. Having to open the Control Panel and then find the JVM parameters and then figure out how to edit them is not done nicely.

A simple GUI tool would be better than typing -Xmn256m etc.

So is their a file that can be edited and changed or are JVM parameters kept in the registry?

kbr

Posts: 251
Re: Is there a file that can be edited that can change the JVM parameters
Posted: Jul 25, 2008 11:56 AM   in response to: demonduck
 
  Click to reply to this thread Reply

If you're working in the context of applets, I strongly recommend you use the new java_arguments parameter to the applet tag:

https://jdk6.dev.java.net/plugin2/#JAVA_ARGUMENTS

or transition your applet to JNLP and use the functionality available there:

https://jdk6.dev.java.net/plugin2/jnlp/#COMMAND_LINE_ARGS

If you absolutely have to change this globally for backward compatibility reasons, on Windows look in C:/Documents and Settings/(username)/Application Data/Sun/Java/Deployment/deployment.properties. On Unix platforms look in ~/.java/deployment/deployment.properties. Note that this file format is not specified and in fact changed in 6u10, so I don't recommend you go down this route at this point.

demonduck

Posts: 382
Re: Is there a file that can be edited that can change the JVM parameters
Posted: Jul 25, 2008 12:21 PM   in response to: kbr
 
  Click to reply to this thread Reply

Thanks for pointing me to the right file. I'm going to look into writing a little client side Java app that changes that file with appropriate JVM parameters.

The Java Control Panel could do that but.... Expecting average people to enter arcane JVM args in the Control Panel is way to optimistic. A little GUI where they can click a check box for 256meg starting memory is practical and doable.

Also, I will *NEVER* transition my applets to JNLP. That's way over kill for the few parameters I need and the simple JVM parameters I need.

And it will be a long, long time before everyone will be updated to the point where java_arguments parameters will be practical. That's a whole generational shift. I expect it will be two or three years before java_arguments will be widely used. It's a great idea and should have been in place from day 1 -- but ....

joshy

Posts: 90
Re: Is there a file that can be edited that can change the JVM parameters
Posted: Jul 25, 2008 2:13 PM   in response to: demonduck
 
  Click to reply to this thread Reply

I'd like to clarify something. Ken (kbr) wasn't suggesting you switch from applets to Java Web Start. He's recommending you specify your applet using a JNLP file rather than putting the many parameters into the applet tag itself. By using a JNLP file you not only keep your applet configuration more organized, but you can take advantage of many new features like JNLP extensions (required for 3D support) and shared library caching. In the future more and more libraries will move to JNLP extensions. All you will have to do is create a small XML file on your server next to your webpage. For more information on the JNLP support see this page:

http://forums.java.net/jive/thread.jspa?messageID=289441&tstart=0#289441

joshy

Posts: 90
Re: Is there a file that can be edited that can change the JVM parameters
Posted: Jul 25, 2008 2:14 PM   in response to: joshy
 
  Click to reply to this thread Reply

Whoops. I meant this link:

https://jdk6.dev.java.net/plugin2/#JNLP

demonduck

Posts: 382
Re: Is there a file that can be edited that can change the JVM parameters
Posted: Jul 25, 2008 3:09 PM   in response to: joshy
 
  Click to reply to this thread Reply

Hi joshy,

I understand that. If I intended that I was the only one to use my applet, then the JNLP method of configuring my applet would make sense. But I'm hoping that others will deploy it. And that rouses the same old problem of the lack of technical sophistication and/or the willingness to do anything more than point and click. Most people just don't want to be bothered. I've been an applet developer for 8 years now. I know the average level of resistance to doing things that you and I and kbr wouldn't even think twice about doing.

For example: just asking people to type -Xms256m -Xmx512m in the JVM parameters slot in the Control Panel causes riots. I've been through this. People just freak out when you ask them to deal with xml or ivp files or other proprietary files for applet configuration or Flash viewers.

And using a JNLP file to configure an applet means you now have an HTML file *AND* a JNLP file to maintain. Think of the nightmares on a big site that is getting reorganized.

On the other hand, I think the JNLP configuration has great utility and any tools that make that more accessible to me and more importantly others would be very useful tools. So is there a GUI that will assist in editing JNLP files?

I have not studied the problem but the first thing that comes to mind is to expand the applet tag even further to recognize JNLP arguments. Maybe that can already be done. That simplifies website and keeps applets, html pages and JNLP config information all in one file.

demonduck

Posts: 382
Re: Is there a file that can be edited that can change the JVM parameters
Posted: Jul 26, 2008 1:40 PM   in response to: demonduck
 
  Click to reply to this thread Reply

Here's an example of how a lot of people think about Java and complex configuration files...

From PanoGuide

http://www.panoguide.com/forums/qna/5142/

Note: pure tools refers to PurePlayer from Immervision which is a Java panorama viewer.

quote:
After this I decided to quit with pure tools untill they have a good gui, comparable with 3dvista or easypano. I spend wayyyy to much hours on xml/javascript coding. I just can't be bothered with that! Besides that, I have the idea that java is obsolete, so I switched to flash tours.
unquote:

Please -- simplify the use of Java.

carcour

Posts: 79
Re: Is there a file that can be edited that can change the JVM parameters
Posted: Jul 26, 2008 2:51 PM   in response to: joshy
 
  Click to reply to this thread Reply

Joshua you're certainly right but where's the Mac support? It's still not there. Unless we have a Java 6 Update 10 available for Mac it's not viable to use this option as more and more people are turning to the Mac platform.

andrewherron

Posts: 51
Re: Is there a file that can be edited that can change the JVM parameters
Posted: Jul 26, 2008 3:38 PM   in response to: carcour
 
  Click to reply to this thread Reply

Unfortunately Mac support is out of Sun's control. Apple are the ones to blame, while they have released a version of Java 6 for OS X it's pure 64-bit so can't be used to runs applets until someone releases a 64-bit browser.

carcour

Posts: 79
Re: Is there a file that can be edited that can change the JVM parameters
Posted: Jul 26, 2008 5:02 PM   in response to: andrewherron
 
  Click to reply to this thread Reply

We all know that it's not Sun's fault but it's Sun that want's to promote JavaFX and make it the best RIA not Apple. Therefore Sun has to find a solution for that.

The developers don't care about this fact and that's why applets are not used on the web and that Flash is the most widely used technology for RIAs in the browser. An example of the demise of applets is the Tennis Grand Slams Live scoring system for which IBM is the technology provider which were using a Java applet 4 years ago and since then they switched to a Flash based solution because of the problems applets had. Don't get me wrong applets were a powerful technology for that time but the large installation of the JRE coupled with the installation problems as well as the slow startup killed the whole experience.

I love Java and have done some applets but clearly I don't feel there's any future there unless we have Java 6 Update 10 for the Mac, we also need the JRE to start faster, it's still not as fast as Flash even with the Plugin 2 and Java 6 Update 10. When a page with Flash loads we barely notice it while we can clearly tell that an Applet is being loaded because of the speed and the ugly tray icon http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6694710.

Java desktop apps run great on current hardware with Java 6 on Windows and Linux or Java 5 or 6 on the Mac. Webstart is fine and could be improved I think Java's future is mostly in these kind of apps.

cowwoc

Posts: 1,055
Re: Is there a file that can be edited that can change the JVM parameters
Posted: Jul 26, 2008 7:32 PM   in response to: carcour
 
  Click to reply to this thread Reply

I personally think that the startup time is "good enough" to warrant shifting our focus to other problems. There are plenty of remaining UI issues not solved by update 10 which makes applets feel slower than they really are and harder to develop than need-be. Flash might start up 2x faster but I still think update 10 applets are fast enough.

With respect to Mac support, has anyone established how much work it would be for Sun to port the Linux/BSD version to MacOSX? You've got to weigh the market-share of MacOSX against the amount of effort. The marketshare might be growing but it is still quite small. That being said, my gut feeling is that porting from Linux/BSD wouldn't take so much effort (the GUI components being the exception). Anyway, I don't think it is vital to know this information before making a decision one way or another.

andrewherron

Posts: 51
Re: Is there a file that can be edited that can change the JVM parameters
Posted: Jul 26, 2008 8:27 PM   in response to: cowwoc
 
  Click to reply to this thread Reply

The advantage of Apple controlling Java is that the platform l&f is damn near perfect. If someone else was doing it, I doubt we'd see options like this:
http://developer.apple.com/technotes/tn2007/tn2196.html

carcour

Posts: 79
Re: Is there a file that can be edited that can change the JVM parameters
Posted: Jul 26, 2008 9:54 PM   in response to: andrewherron
 
  Click to reply to this thread Reply

You're right. At the end of the day we all like the native look and feel of a UI. Not having a context menu in JTextComponent is really strange as Windows, Mac and Linux all provide this facility by default was this taken from CDE (I don't even know if it provides context menus), I've always complained but no one seems to care. I know it could be added but it's not the kind of code you want to add, the control should provide it by default or it should be optional.

Most of the Swing apps I've seen do not have context menus except the good ones. It's also time for SwingX to be included in the JDK as it's impossible to write anything good looking without including SwingX.

mbien

Posts: 157
Re: Is there a file that can be edited that can change the JVM parameters
Posted: Jul 27, 2008 5:37 AM   in response to: cowwoc
 
  Click to reply to this thread Reply

regarding update 10 on OS X:
"Sun and Apple are working together both to port the new Java Plug-in to Mac OS X as well as to bring updated versions of Java SE to Mac OS X more quickly. "

When can we expect to see 64-bit support in the Java Plugin?
"Likely 6u11 or 6u12. The new Java Plug-In is already working trivially in 64-bit mode because it contains very little native code. We will likely have a public beta of the 64-bit Java Plug-In before its official release as well. "

http://java.sun.com/developer/community/askxprt/sessions/2008/jl0707.jsp

dserodio

Posts: 20
Re: Is there a file that can be edited that can change the JVM parameters
Posted: Jul 29, 2008 7:56 AM   in response to: cowwoc
 
  Click to reply to this thread Reply

I agree. Startup time is "good enough", but the Yahoo Toolbar and OpenOffice ads in the JRE installation (along with the annoying tray icon) are the worst offenders.

cowwoc

Posts: 1,055
Re: Is there a file that can be edited that can change the JVM parameters
Posted: Jul 29, 2008 10:13 AM   in response to: dserodio
 
  Click to reply to this thread Reply

> I agree. Startup time is "good enough", but the Yahoo
> Toolbar and OpenOffice ads in the JRE installation
> (along with the annoying tray icon) are the worst
> offenders.

Funny you should mention. I don't mind the OpenOffice background ads at all, though I do the rest of the items you mentioned.

demonduck

Posts: 382
Re: Is there a file that can be edited that can change the JVM parameters
Posted: Jul 29, 2008 5:07 PM   in response to: kbr
 
  Click to reply to this thread Reply

> If you're working in the context of applets, I
> strongly recommend you use the new java_arguments
> parameter to the applet tag:
>
> https://jdk6.dev.java.net/plugin2/#JAVA_ARGUMENTS
>
[stuff deleted]

I installed 10u28 -- made a test applet with
<PARAM name="java_arguments" value="-Xmx256m -Dsun.java2d.noddraw=true">

Works Great!

Now all I have to do is edit all 200 html pages to add that applet param. And all the people who have actually taken the time and effort to change their JVM args to raise the startup memory for an applet will suddenly find that their Runtime Args have vaporized and there will be nothing they can do to fix applet failures until the person who deployed the applet re-edits their applet tags. And there are going to be some that never will re-edit their applet tags.

Really, take a minute to think before you act. Black or white; this or that; is a cruel way to do things. When you are transitioning between paradigms, you have to service both for a while until the new paradigm is nearly universal. Please do not evaporate JVM arguments when 10 is finally released.

I'm biteing my tongue ... I could say more.

demonduck

Posts: 382
Re: Is there a file that can be edited that can change the JVM parameters
Posted: Jul 29, 2008 8:33 PM   in response to: demonduck
 
  Click to reply to this thread Reply

Environment: FF2 ; 1.6.0.10u28 ; Windows2000 SP4

I noticed something odd. I made a test page with the java_arguments param

<PARAM name="java_arguments" value="-Xmx256m -Dsun.java2d.noddraw=true">

It loads and runs fine. But if I refresh the page, I get an out of memory error.

Try it yourself.

http://pancyl.com/stereo.htm

Why should I get an out of memory error when I refresh the page?????

hdong

Posts: 7
Re: Is there a file that can be edited that can change the JVM parameters
Posted: Aug 14, 2008 1:26 PM   in response to: demonduck
 
  Click to reply to this thread Reply

It's likely that references to previous applet have not been cleared yet. There is a known issue with some Swing components.

demonduck

Posts: 382
Re: Is there a file that can be edited that can change the JVM parameters
Posted: Aug 14, 2008 2:49 PM   in response to: hdong
 
  Click to reply to this thread Reply

> It's likely that references to previous applet have
> not been cleared yet. There is a known issue with
> some Swing components.

I don't use Swing in my applets. Only AWT and only one Panel and one Canvas.

hdong

Posts: 7
Re: Is there a file that can be edited that can change the JVM parameters
Posted: Aug 14, 2008 1:28 PM   in response to: demonduck
 
  Click to reply to this thread Reply

This is a bug. The parameters in java control panel should be preserved.

demonduck

Posts: 382
Re: Is there a file that can be edited that can change the JVM parameters
Posted: Aug 14, 2008 2:51 PM   in response to: hdong
 
  Click to reply to this thread Reply

> This is a bug. The parameters in java control panel
> should be preserved.

Finally, someone with some brains answers.

I hope you (Java Dev Team) are working on it because it's a show stopper for me and my applets.

Let me know if you want me to test a version that fixes the bug. I have plenty of tests.

hdong

Posts: 7
Re: Is there a file that can be edited that can change the JVM parameters
Posted: Aug 14, 2008 6:05 PM   in response to: demonduck
 
  Click to reply to this thread Reply

I did a little more research and found out that the problem is only with "-rc" or "-beta" versions of plugin. When 1.6.0_10 is finally released, the version string will be "1.6.0_10". Plugin works fine to set/get jvm parameters when version string is "1.6.0_10".

I am surprised that this issue was not discovered earlier. It was probably because the internal test binary use "1.6.0_10" as version string.

Yeah, it is a bug that will affect many manny developers. It will be fixed as soon as possible.

demonduck

Posts: 382
Re: Is there a file that can be edited that can change the JVM parameters
Posted: Aug 14, 2008 8:41 PM   in response to: hdong
 
  Click to reply to this thread Reply

WHEW!

Now maybe I can get some sleep tonight.

THANK YOU!!!!




 XML java.net RSS