If you need to compile a Java program with the Command Prompt, but it pops up the following error message:

‘javac’ is not recognized as an internal or external command, operable program or batch file.

 

How to solve the problem of "javac is not recognized as an internal or external command..."

 

Follow the steps below to solve the problem:

Firstly go to Computer, right click on an empty spot on the screen (sostituirei con window, anche nell’articolo originale) > Properties.

 

How to solve the problem of "javac is not recognized as an internal or external command..." 2

 

Secondly, in the left menu, click on “Advanced system settings”.

 

How to solve the problem of "javac is not recognized as an internal or external command..." 3

 

In the window that appears go to “Advanced” and then click on the button “Environment Variables…”.

 

How to solve the problem of "javac is not recognized as an internal or external command..." 4

 

Now in the scrolling window click on “Path” and then on the “Edit” button.

 

How to solve the problem of "javac is not recognized as an internal or external command..." 5

 

You will be faced with this window with a list of variables.

Choose the first at the top of the list:

 

How to solve the problem of "javac is not recognized as an internal or external command..." 6

 

Without closing anything, go to Computer > Local Disk (C:) > Programs > Java, and enter the folder with the latest version of JDK, as an example:

 

How to solve the problem of "javac is not recognized as an internal or external command..." 7

 

Then enter the “bin” folder.

 

How to solve the problem of "javac is not recognized as an internal or external command..." 8

 

Select the address in the top bar and copy it.

 

How to solve the problem of "javac is not recognized as an internal or external command..." 9

 

Now go back to the small window that you left previously opened, delete all the contents of “Variable Value:” and paste the address you just copied.

 

How to solve the problem of "javac is not recognized as an internal or external command..." 10

 

Finally click OK > OK > OK, close the window of the Windows’ informations and at this point you can go to run all the Java commands (such as ‘java’, ‘javac’, ‘javap’, …) from the Terminal.

Categories: PRO userWindows