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 ....