Java Environment Variables and basic compilation operations

Source: Internet
Author: User
1. Environment variable Setting

My Computer right--Properties--Advanced system settings-environment variables--System variables (new)

Variable name: java_home (New)
Variable Value: C:\Program files\java\jdk1.7.0
Variable name: CLASSPATH (New)
Variable value:.; %java_home%\lib\dt.jar;%java_home%\lib\tools.jar; (Note the preceding punctuation.)

Variable name: Path (Append)
Variable value:%java_home%\bin;%java_home%\jre\bin;

2. JDK compiled Java file

There are javac.exe programs in the Java_home\bin directory to compile Java files

The wording is: Javac *.java

* For Java names, Java files should be placed under the bin directory.

3. Run the class file

Java *

* As class file name, you need to run the command in the class directory

4. Running the jar package

Java-jar *.jar

* For file name, run the command in the jar file directory

Java Environment Variables and basic compilation operations

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.