About Java packaging issues

xiaoxiao2021-03-05  22

Create a new Java file, such as called Test.java, compile the test.class file, write a list of manifests, called hello.txt (what doesn't care, just a name) Hello.txt

Manifest-Version: 1.0main-class: test (Note that this must be added to a carriageway, otherwise you get the .jar file in the Manifest, there is no main-class: Test this sentence, remember !!!)

Then perform the following statement at the command line: JAR CVFM Test.jar Hello.txt Test.class (if there are multiple Class files, use * .class represented)

This will get a Test.jar file in the current directory, double-click, can be executed (only the window program can, it is impossible to the command line program)

转载请注明原文地址:https://www.9cbs.com/read-35863.html

New Post(0)