A jar file that can be double-clicked

Source: Internet
Author: User

It took N minutes to finally create an executable JAR file. I am afraid to share it with you.
If you want to download this file, go to http://yourhome.arkoo.com/lilao/a.rar.

As a beginner, I prefer the following mistakes:
1) Not all java can be packaged into a jar package, as if there is no frame (not sure)
Because the results run after packaging, there is no display. I tried one and didn't report an error. Maybe if you don't want to give feedback, you can. But I did not try this.

2) think that you can double-click the jar package to run it.
Actually not. The executable JAR file must be described in the MANIFEST. MF file with the Main-Class option.

3) when explaining the Main-Class, you must specify that you are an entry Class.
I thought it was based on the file directory. In fact, this is only superficial. The first is package. If you do not have a package, you can only put it in the root directory. Only when you have a package can you have a corresponding folder. In this way, the main-class is located by folder. If one item does not match, neither can it be done. "cocould not find the main class. Program will exit!" may occur !" .

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.