Javac Not Found Windows 10

Javac

It looks like the javac executable cannot be found because you did not set your PATH environment variable to include it. This is a simple fix. This is a simple fix. Since you are clearly using Windows XP. If not found javac.exe file, need to install the java properly on windows 10 machine. If javac.exe file is found then try to configure java jdk bin location directory path in environment path variable to use javac command in any path directory. I need javac so I came to know that this is available only if I install JDK. So I installed JDK by executing the following command yum install java-1.7.0-openjdk-devel.

This tutorial shows you how to set a JAVA_HOME system variable on Windows 10.

Tested with :

  1. Windows 10
  2. JDK 1.8

1. Advanced System Settings

Type advanced system settings in the search box (beside the Windows start button), clicks View advanced system settings.

2. Environment Variables

Select Advance tab, clicks Environment Variables

3. Add JAVA_HOME

In System variables, clicks New... button to add a new JAVA_HOME variable and point it to the JDK installed folder.

Note
Don’t include the bin folder, just the JDK path. For example
  1. Correct – C:Program FilesJavajdk1.8.0_60
  2. Wrong – C:Program FilesJavajdk1.8.0_60bin

4. Update PATH

In System variables, find PATH, clicks edit... button :

4.1 In old version of Windows, it will prompt you below dialog box to edit the values directly, append this %JAVA_HOME%bin; to the end of the line.

4.2 In latest Windows 10, it will prompt you below dialog box, clicks on New button, and add this %JAVA_HOME%bin

Javac Command Not Found Windows

Note
Puts the %JAVA_HOME%bin in PATH make all the Java’s commands (java, javac, jstack and etc) are accessible from everywhere.

5. Test

Open a command prompt, type :

References

About the Author

mkyong
Founder of Mkyong.com, love Java and open source stuff. Follow him on Twitter. If you like my tutorials, consider make a donation to these charities.

Comments

Active7 months ago

I have CentOS 6.7. I have installed Java 1.8. When I do Java -version I see the following output.

java version '1.8.0_121'

Java(TM) SE Runtime Environment (build 1.8.0_121-b13)

Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)

I need javac so I came to know that this is available only if I install JDK. So I installed JDK by executing the following command

yum install java-1.7.0-openjdk-devel

The installation was successful. But now when I again execute the command java -version, I see the old result. If I try to execute javac at the command prompt I see the error '-bash: javac: command not found'. I observed that OpenJDK was installed to the directory /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.131.x86_64/bin. So, I set it to JAVA_HOME, but I still cannot execute javac command. What am I doing wrong here?

Jeff Schaller
50.3k11 gold badges74 silver badges167 bronze badges
KurioZ7KurioZ7
2635 gold badges8 silver badges17 bronze badges

1 Answer

I have fixed this issue by executing the following command. I was not setting the PATH variable properly. I executed the following two commands and my problem was fixed.

Javac Not Recognized Windows 10

Romeo Ninov
7,7923 gold badges21 silver badges29 bronze badges
KurioZ7KurioZ7
2635 gold badges8 silver badges17 bronze badges

Javac Not Found Windows 10 Dell

Not the answer you're looking for? Browse other questions tagged centossoftware-installationjava or ask your own question.