0

Hi all,
I added -Djava.library.path="C:\Documents and Settings\users" in properties of my project and my application works fine, i created a jar and run with
java -Djava.library.path=C:\Documents and Settings\users"-jar Host.jar it worked fine but when we double click Jar it only runs with "java -jar host.jar".So i want to add this VM option permanently while creating a jar.. it is Possible.....??

Any suggestions will be appreciated

Thanks in Advance

2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by ~s.o.s~
0

AFAIK, no, not possible since a JAR file is just a zip file and is not capable of containing that sort of meta-data. This is the reason you'll notice that applications which rely on running a JAR also supply a shell script for that given platform which fires the JAR by setting the relevant options.

Solution would be to ship your JAR file with a shell script for each platform you are shipping on or use something like JSmooth which provides a thin executable wrapper over your JAR file and I think it also supports passing in JVM parameters.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.