Use jar to package the code in win7 and double-click to open the jar file.

Source: Internet
Author: User

1. Use jar to packageCode

Jar-cvfm my. Jar myframe. config myframe

Explanation: My. jar is the JAR file to be generated in the current directory. Its name can be obtained by itself, but its suffix must be jar.

Myframe. config is a configuration file created in the current directory (you must create this file before using this command). The file can be in the TXT file format.

The content is as follows:

Main-class: myframe. frameevent

Note that there is a space behind the colon, and a line break is generated. Myframe is the package name ). Frameevent is the class of the main method.

Myframe is the folder of the set of compiled class files in the current directory.

Method for generating the myframe Folder:

Run: javac-d e: myframe. Java

The myframe directory is generated in the root directory of the E disk. The myframe name depends on the package name.

2. Double-click to open it. Right-click my. jar and select the option to open it with javaw.exe. Then, select the check box for the default option to open.

If not, it may be a problem with environment variables and the registry ....

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.