I've built a program that allows users to create and manage a digital journal and other notes. It works alright and still needs some polishing but that's not the point. It references Java and JavaFx classes through imports. There is only one file, everything is compressed and inside that. It doesn't reference other files, except those created by the program.
I've tried many things, but nothing has seemed to work. I've tried exporting the file as runnable jar file and a normal jar file, changing how the libraries are extracted, changing command line arguments, running it through launch4j (which I still don't grasp a good understanding of, which may be a problem) and nothing has worked. Does anyone know the full process, and can walk me through it?
CodePudding user response:
create an executable jar file using command prompt
We need to create a manifest file i.e " manifest.txt "
manifest.txt
Main-Class: classname
Mandatory : Manifest file should end with the new line character .
Here Main-Class is the entry gate of the jar file (which we are going to create) , when anyone click on the executable jar file , JavaHungry main() method will be launched .
- So we need to create the jar file , so we should always put manifest.txt and classname.class together .
So in computer directory it will look like
C:\java\classname.class
C:\java\manifest.txt
So the following command needs to be executed to create the executable jar of classname file .
jar -cvfm classname.jar manifest.txt *.class