CMD instruction javac is not an internal instruction

Step 1.window + r → enter cmd → press Enter (or click "OK") → enter java -version:

Step 2.A: There is JDK in the computer, return the JDK name, etc., and continue to step 3.

          B: Nothing, tsk, please download the JDK first (I won’t go into details here, go to Baidu by yourself)

Step 3. Find the storage location of your JDK, for example, my location is: D:\JDK\jdk1.8.0_271

Step 4. Right click on "This PC" → select "Properties" → select "Advanced System Settings" → Environment Variables

 

Step 5. Click "New" under "System Variables" → fill in "JAVA_HOME" in "Variable Name" → fill in the storage location of JDK in "Variable Value", mine is: D:\JDK\jdk1. 8.0_271 (introduction in step 3) → click "OK"

Step 6. Click "New" under "System Variables" → fill in "classpath" in "Variable Name" → fill in ".;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\ lib\tools.jar" (directly copy the content in "", be careful not to miss the first .;) → OK.

Step 7. Find "path" → Edit → New → Fill in "%JAVA_HOME%\bin" → New → Fill in "%JAVA_HOME%\jre\bin" → OK ("OK" all the way until the initial computer information interface )

Step 8: window + R → enter cmd → enter/OK → enter javac → enter → enter javah → enter

 

Well, that's the end of it. If step 8 is still javac or javah is not an internal command, it is recommended to start again from step 1 and proceed seriously.

 

Guess you like

Origin blog.csdn.net/qq_41873558/article/details/116539064