I am going to participate in a game jam tomorrow, and I am going to make the game with java in visual studio code. The only problem is once I finish the game I don't know how to export it to an executable jar file. I am posting this question to ask if there is a command in visual studio code that will allow me to export it.
I assume your project is no build tools, so here is my solution about export ing projects to jars. Turn to folder src
:
Compile the .java file with main
method, which generates the .class file:
javac App.java
Generate .jar:
jar cvfe App.jar App .\
Run the jar:
java -jar App.jar
Detailed command information, please view The Jar Command.