Question

I'm having a hard time figuring how to convert jar files with its libraries into an .exe file. I know how to convert jar files(ONLY) to an .exe file using JSmooth but I don't know how to add its libraries in it.

What I'm trying to accomplish is that I wanna execute the file without having the \lib and jar file(s) in the location of .exe file. I want the .exe file to be independent.

'Cause The scenario I've encountered was that I have this .jar file, the lib folder, and the .exe file in the same location. When I try to execute the .exe file nothing's wrong, it worked well. When I try to move away the .exe file from the jar file and the \lib. It won't worked anymore. Is there a way that I can just delete the jar and the lib folder but leaving the .exe file working just fine?

No correct solution

OTHER TIPS

You can run your exe from anywhere depending you have the jars in your classpath. You can make use of environment variable to set the class path and simply put this in your exe:

For windows:

java -classpath .;local.jar MainClass

For unix/linux:

   java -classpath .:local.jar MainClass
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top