Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Changing java system properties permanently

 
andy armstrong
Ranch Hand
Posts: 154
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to be able to add a system property for all java apps run
on my xp windows box. For example add the
-Dcom.jmx.remote to all java applications run.

IS there a properties file I can edit to add the parameter.
 
Rob Spoor
Sheriff
Pie
Posts: 20527
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On Windows:

C:\Documents and Settings\<your name>\Application Data\Sun\Java\Deployment\deployment.properties

For instance, after setting parameter "-Xmx500" for applets using the control panel, the following line appeared:

Now that is for applets - I have no idea if that also works for "regular" applications. But that's most likely the place to go.
 
andy armstrong
Ranch Hand
Posts: 154
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This does not work. It only sets the properties for app run using webstart.
I want the property to be set for any java application run.
 
andy armstrong
Ranch Hand
Posts: 154
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where do the default system propeties get set?
 
Sivaraman Lakshmanan
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Andy,
You can set the system property value by just have a simple batch file with all the properties you want to set and run the batch file before your application starts. One more way is you can set the property in the environment variable setting of your system.

If you are using any servers you can drop the variable in the startup batch file also

Hope this helps.
 
andy armstrong
Ranch Hand
Posts: 154
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The point is I do not want to set them on the command line. If you
set them as a environment variable they do not get picked up. I want the variables to run for any jre that is run.
The question still remains where can you set the default system properties in java?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic