views:

32

answers:

1

Hello,

I need to be able to pass option flags to Java when my users execute a given Jar file. I am using Netbeans as my IDE and it would be nice if I could set it somewhere inside there to avoid manually changing each jar file to do this.

I know under the project if you right click, go properties, then run, you can set options there but I don't believe it builds it into the distributable jar file.

Please note I am NOT asking how to read parameters passed to the jar program itself, I need to pass options to Java.

A: 

fd is correct. The options read out of a jar and applied to the JVM being launched are pretty minimal... but there may be another way to approach this.

You can use the javaws command to read a JNLP file that will create a JVM that is much more customized. If your users will have access to a common site, you can probably just distribute the jnlp file and let javaws handle accessing the jar file for your app. If users will not have access to a common server, you will want to distribute both files (jnlp and jar) and let them install them together.

vkraemer