Java: Compile and run Java applets manually
Example: Java \ jdk1.6.0 _ 27 \ demo \ jfc \ tableexample \ In the JDK directory \
Java \ jdk1.6.0 _ 27 \ demo \ jfc \ tableexample \ SRC has its source code:
Then, move the SCR folder to the D: directory.
Open CMD and enter D: \ SRC
First, we need to compile the *. Java file into the *. Class Java bytecode file:
Enter javac *. Java in cmd.
After generation:
Then we create a new mani.txt in this directory.
Content:
Manifest-version: 1.0
Main-class: tableexample (enter here)
Then we can use the jar command to generate the final executable file named *. Class. jar.
Input: jar cvfm tableexample. Jar mani.txt *. Class
The tableexample. jar file is generated.
Then, you can directly run Java-jar tableexample. jar or double-click the JAR file.
We use WinRAR to open the jar file
Then open the manifest. MF file in the META-INF:
We found that tableexample. jar is the *. Class bytecode file generated by javac + the parameters given by the mani.txt file are simply packaged and compiled.