hi
i would like to create an executable jar file that runs by double clicking ..
could someone please explain it step by step
thank you in advance
Printable View
hi
i would like to create an executable jar file that runs by double clicking ..
could someone please explain it step by step
thank you in advance
ok i have managed to create the jar file but i am getting an error message
""could not find the main class . program exit ""
anyone can help !!
Are you working on any IDE? Most of the IDE create a jar file of your project.
How did you create that jar file? Seems to me that you don't have included manifest.mf or, that file is failed to link your main class
Here's what you need to do:
1. You should have a Manifest.mf file, which will contain the following lines.
I am using HelloWorld.java as example.
NOTE: Make sure you hit ENTER at the end of the line (Manifest.mf file).Code:Main-Class: your.package.HelloWorld
2. Next create your jar file, as follow:
That's it. You can run it by double clicking on it and or as follow:Code:>jar cmf Manifest.mf hello.jar *.*
Code:>java -jar hello.jar