I have around 10 java files with their corresponding class files. The whole application works when i execute one of the main class. I execute it using cmd. I need help converting it into a single self executing file. eg: exe or jar
Asked
Active
Viewed 70 times
-3
-
In case you are using an IDE, it should do it all for you. – Kedar Parikh Feb 27 '15 at 05:41
2 Answers
0
A jar file is little more than just a zip of all classes and resource files. You need to add details into META-INF/MANIFEST.MF file so that the class containing the main method to be executed is know.
This should help: Link
You can try invoking the jar file as follows:
java -cp <jarfile.jar> <Complete.Package.ClassNameWithMainMethod>

Kedar Parikh
- 1,241
- 11
- 18
0
You can make jar by Exporting the project using following methods in Eclipse IDE
File->Export->Java->JAR.
Note: This is already have a solution to change to exe or JAR. How can I convert a .jar to an .exe?

Community
- 1
- 1

Gowtham Murugesan
- 407
- 2
- 6
- 17