开发者

How to pass options to a jar file using Netbeans

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 fi开发者_开发知识库le 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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜