'Javac' is not an internal or external command, nor a program or batch processing file that can be run...

Source: Internet
Author: User

Today, when I used cmd to edit Java on my computer, the error "'javac' is not an internal or external command, or a program or batch file that can be run" was prompted. Write down the solution process. If you encounter the same problem, refer to it.

1. First download the latest JDK version. Go to http://java.sun.com/javase/downloads/index.jspto download the latest JDK 1.6. I installed it in "C: \ Program Files \ Java \ jdk1.6.0 _ 10" (for example ).

2. Configure after installation. Right-click "my computer", open "properties", and select "environment variables" in "advanced ". In the new interface, you must set three attributes for system variables. In a computer without JDK installed, the path attribute already exists.

1) Click "new" in "User variables", write "java_home" in the variable name, and write the installation path "C: \ Program Files \ Java \ jdk1.6.0 _ 10 ".

2) Find the path in the system variable and click Edit. Path means that the system can recognize Java commands in any path. Add the variable value "; C: \ Program Files \ Java \ jdk1.6.0 _ 10 \ bin; C: \ Program Files \ Java \ jdk1.6.0 _ 10 \ JRE \ bin ". (Note: The red part is based on your own installation address; the front seal number cannot be less)

3) Click "new" in the system variables and enter "classpath" in the variable name. This variable indicates the path of the Java loading class (bin or Lib). Only the class is in classpath, java commands can be recognized. The value is "C: \ Program Files \ Java \ jdk1.6.0 _ 10 \ Lib \ DT. jar; C: \ Program Files \ Java \ jdk1.6.0 _ 10 \ Lib \ tools. jar "(Note: The red part depends on your installation address ).

3. verify whether the installation is successful. Click "start"-> "run", enter "cmd" to go to the command line interface, and enter "Java-version". If the installation is successful, the system displays Java version "1.6.0 _ 10 "..... (different version numbers are different)

Problem Solving

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.