1. Save all your classes in the package, create a new TXT file in the folder in the package, and deposit the following information Main-class: Package name. class Name Note the last example to add a carriage return is as follows
2dos command line in the current folder enter JAR-CVFM custom jar name The name of the package name in the previous step defines the following example
3. Open the package to open the jar file and then view the MANIFEST.MF file in Meta-inf the following is successful, you can double-click to execute
Note: win10 register jar file
Add the registry, press Win+r, type regedit, enter.
"Note" If you do not open regedit (Registry Editor) then look at the following line, open the can ignore
Enter the Dism/online/cleanup-image/restorehealth command in cmd and press ENTER. To run CMD as an administrator, you will not be prompted for permissions
In Registry Editor, locate the "Hkey_classes_root\applications\javaw.exe\shell\open\command" in which the file Open command adds the parameter "-jar" (no quotation marks), and the modified value is similar to the following: "" D:\Program files\java\jdk1.8.0_25\bin\javaw.exe "-jar"%1 "" (only need to add-jar parameter, no need to modify additional information, "note"-jar with spaces between the front and back quotes), Save and Exit Registry Editor. Like this.
How the Java program creates a new jar package (double-click execution)