Java: Compile and run Java applets manually

Source: Internet
Author: User

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.

Related Article

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.