Java file package jar run
Effective steps:
1.cmd to the current directory (the directory where the default package main class is located is used as an example) set classpath = the directory where the default package main class is located
2.javac main class name.java
3.java main class name
4. Write a list file
Manifest-Version: 1.0 Created-By: 1.8.0 (Sun Microsystems Inc.) Main-Class: Main class name
created-by version number is not known -> Enter cmd and enter java -version
5.jar cfm Custom.jar MANIFEST.MF *.class
6. Customize a bat file (batch file is the default entry if it is occupied by decompression applications)
Content: javaw -jar Custom.jar
7. Double-click the bat file to run the two files obtained above on a computer with jdk installed
Expand: JAR package with package management (only list inconsistent steps)
2.javac -d . *.java (note spaces)
3. Package name. Main class name in java program
5.jar cfm Customize .jar MANIFEST.MF package name/*.class in the program
7. The package write command is java -cp custom package name and main class name in the program
If you need to close cmd as soon as you open it in bat: start javaw -jar custom.jar (single process, the effect is pretty good)
The above example of Java generating jar packages and running a single process is all the content I share with you. I hope you can give you a reference and I hope you can support Wulin.com more.