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

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.