When running the command javac in cmd, "javac is not an internal or external command"

Source: Internet
Author: User

This is an environment variable problem. follow these steps:
1. Environment variable settings:
In system variables (or user variables), click Create:

Variable name: java_home

Variable value: C: \ Program Files \ Java \ jdk1.6.0 _ 10

Click New again:

Variable name: classpath

Variable value:.; % java_home % \ Lib \ tools. Jar

And add it to the path (do not delete the original ones); C: \ Program Files \ Java \ jdk1.6.0 _ 10 \ bin

Then execute the Java and javac commands at the command prompt to see if they can be run.

2. javac is not an internal command:
Run the command directly in cmd mode (the path name ):
Set Path = c: \ Program Files \ Java \ jdk1.7.0 _ 07 \ bin
Set classpath = c: \ Program Files \ Java \ jdk1.7.0 _ 07 \ Lib \ tools. jar; C: \ Program Files \ Java \ jdk1.7.0 _ 07 \ Lib \ DT. jar; C: \ Program Files \ Java \ jdk1.7.0 _ 07 \ bin

3. Add JDK to myeclipse
Window-> preference-> JAVA-> installed jres
Click Add, select standard Vm, and select JDK installation path for jre home, for example, c: \ Program Files \ Java \ jdk1.7.0 _ 07.
Run the following code:
Public class test {
Public static void main (string [] ARGs ){
System. Out. println ("JDK version (Java. Version)" + system. getproperty ("Java. Version "));
}
}
Check whether the version number is correct.

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.