-
November 2nd, 2017, 08:01 PM
#1
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.
C:\Users\olivi\JavaSource>C:\\"Program Files\"\Java\jdk1.8.0_05\bin\javac Hello.java
The system cannot find the path specified.
-
November 3rd, 2017, 04:12 AM
#2
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.
-
November 5th, 2017, 12:31 PM
#3
Re: Javac not recognized in cmd prompt
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|