Javac not recognized in cmd prompt
Hello, I just began learning Java programming today. I am going through a course online very basic instructions of writing the source in notepad and saved as Hello.java under all files. JDK is downloaded on my Windows 10. Whenever I try to compile I get this message:
C:\Users\olivi\JavaSource>javac Hello.java
'javac' is not recognized as an internal or external command,
operable program or batch file.
I hear this is common problem and can be fixed through a PATH variable. Can anyone describe that to me and the steps so the complier is recognized? Thanks in advance! :)
I tried telling cmd prompt where javac was and it didn't work either. :confused:
C:\Users\olivi\JavaSource>C:\\"Program Files\"\Java\jdk1.8.0_05\bin\javac Hello.java
The system cannot find the path specified.
Re: Javac not recognized in cmd prompt
First make sure you have installed jdk and jre, both are installed with the java software development kit. The installation folder is typically C:\Program Files\Java.
Now go to Computer > Properties > Advanced system settings in the advanced tab click on Environment Variables
In System variables find the variable named Path, in the value of Path you will find a java path like C:\ProgramData\Oracle\Java\javapath, just change it to C:\Program Files\Java\jdk1.x.x_x\bin.
Re: Javac not recognized in cmd prompt