Hello Sir My java class have no main function,i create a .class file...now i want to create a jar file how can i create a jar file?
Printable View
Hello Sir My java class have no main function,i create a .class file...now i want to create a jar file how can i create a jar file?
You might find this helpful.
Q&A : How do I create a .JAR file?
Cheers.
If there is no main function, how are you gonna make the jar file run if you want to? Because the manifest file inside it will need an entry point.
Anyways, if you simply want to make it go here : Creating a JAR File
Goldest
You can put any files you like into a jar file: .class files, image files, anything. And the .class files don't have to define classes with any static main() method. There are details in Oracle's Tutorial in the Packaging Programs in JAR Files section.
(Of course to run a program using the java executable you have to name a class which has a static main() method that can act as the program's starting point, but that is another matter.)
Ya Thank You