Javac is not found
Solution 1
As far as I can see you have the JRE
in your PATH
, but not the JDK
.
From a command prompt try this:
set PATH=%PATH%;C:\Program Files (x86)\Java\jdk1.7.0_17\bin
Then try javac
again - if this works you'll need to permanently modify your environment variables to have PATH
include the JDK
too.
Solution 2
- Go to my computer;
- Right click properties;
- Go to advanced system settings;
- Go to environment variables;
- In user variables for user click on new(top new button, not on system variables);
- Set variable name as:
Path
- Set the value of that variable to:
C:\Program Files\Java\jdk1.7.0_76\bin
- Click ok;
- Click ok;
- Click ok.
Now you're set. Type javac
in cmd. All javac options will be displayed.
EDIT: As @MediaMaker pointed out, after completing the above steps, you need to open a new command prompt for it to work.
Solution 3
Easiest way: search for javac.exe in windows search bar. Then copy and paste the entire folder name and add it into the environmental variables path in advanced system settings.
Solution 4
I'm searched many answers that suggest me to type in cmd:
set path = "%path%;c:program files\java\jdk1.7.0\bin"
but this is WRONG!
the right solution is that you leave "set" and just type
path = %path%;c:program files\java\jdk1.7.0\bin
P/s: of course you have to replace "jdk1.7.0" folder by your current java version folder. This works well on win 7 32bit, but I think it also works on win 8 - try it!
Related videos on Youtube
Arktri
Updated on July 13, 2022Comments
-
Arktri almost 2 years
I'm running Windows 8 and I can not get javac to work.
I have set my PATH in environmental variables to
C:\Program Files (x86)\Java\jdk1.7.0_17\bin
I have tried both with and without ';' but to no avail.
I recently had this issue on my desktop and adding ; worked but it's not in this case.
I have made sure that javac does exist in the bin too.
Any suggestions on fixes would be greatly appreciated.
EDITS echo %PATH% gives:
C:\Users\Arktri\Desktop>echo %PATH% C:\Program Files (x86)\Intel\iCLS Client\; C:\Program Files\Intel\iCLS Client\; C:\Windows\system32;C:\Windows; C:\Windows\System32\Wbem; C:\Windows\System32\WindowsPowerShell\v1.0\; C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x86; C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x64; C:\Program Files\Intel\Intel(R) Management Engine Components\DAL; C:\Program Files\Intel\Intel(R) Management Engine Components\IPT; C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL; C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;; C:\Program Files (x86)\Java\jre7\bin
And the exact error is: 'javac' is not recognized as an internal or external command, operable program or batch file.
-
Max DeLiso about 11 yearscan you start a shell, type
echo %PATH%
and post results? -
Ar5hv1r about 11 yearsWhat is the error that you see? Saying "I can not get [it] to work" doesn't tell us anything about the problem.
-
Eric Leschinski about 11 yearsThe double semicolons might be a problem.
-
FazoM about 11 yearsDo you have an extra space in you path? I can see: Pr ogram Files there...
-
Romain Hippeau about 11 years
-
-
Line about 5 yearsCould you include here the information how to do it permanently?
-
Sean Landsman about 5 yearsI should have when I first posted this answer, but I suggest taking a look at @user4611364 answer below. Doing it that way will set it permanently (assuming you're using windows)
-
MediaMaker over 4 yearsnote that if you already have a cmd open and try to use that, it won't seem to work. You'll need to open a fresh cmd.