How the Java program creates a new jar package (double-click execution)

Source: Internet
Author: User

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.