Java environment variable Configuration tutorial _java

Source: Internet
Author: User

The example of this article for everyone to share the Java environment variable setting method for everyone to refer to, the specific content as follows
After installing the JDK, find My Computer (right) --" properties --" Advanced tab --" environment variables , which have administrator user variables, there are system variables. Choose which one does not matter, I chose the administrator of the user variable is the user variable, click "New", the following is required to fill in the three environment variables, the form is the environment name = Environment Value , in turn, fill in can:

java_home=c:\j2sdk1.5.0 (JDK installation folder location)

Classpath=.; %java_home%\lib\dt.jar;%java_home%\lib\tools.jar; (.;;; Must not be less because it represents the current path)

Path=%java_home%\bin

You can then write a simple Java program to test whether the JDK has been installed successfully:

public class test{public
 static void Main (String args[]) {
  System.out.println ("This is the Test program.");
 }
}

Save the above program as a file with a file name of Test.java.
Then open the Command Prompt window, the CD to your Test.java directory, and then type the following command:

Javac Test.java

Java Test

At this point, if you see the print this are a test program. If the installation is successful, if you do not print out this sentence, you need to carefully check the configuration.

The above is the Java environment variable configuration of the entire content, I hope to help you learn, but also hope that we support the cloud habitat community.

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.