`javac.exe` not found in the `jdk\bin`
Solution 1
It is inside bin directory under your C:\Java\jdk1.8.0_72
.
Now you need to update your Environment variables and append C:\Java\jdk1.8.0_72\bin
to the Path variable after semi colon. Important: do not delete the existing Path variable, just append C:\Java\jdk1.8.0_72
Now reopen the command prompt and type javac.
Edit: Could it be that when installer asked you where you want the JRE installed you pointed to the same dir where you told the installer to put JDK? In that case the installer will overwrite the content of bin of JDK by the content of bin of JRE.
Solution 2
I have downloaded same file and changed install path assuming you also did it.
Same thing happened. Java installer installed a jre under the path i have choosen but also installed a jdk under C:\Program Files\Java\jdk1.8.0_72. Please check that.
I do not know why installer behaves like that but i think you can find javac under C:\Program Files\Java\jdk1.8.0_72\bin
Solution 3
I have had the same problem. However I realized that I did not install the java jdk itself and so, I went to this link and downloaded the windows x64 version and just followed suit.
It worked. May be you can uninstall the java jdk and do it afresh.
Solution 4
You have to choose different destination paths for JDK and JRE, or one will cover another!
For example, this works well:
Solution 5
Make sure you install the Java SDK, and not Java RE. I installed Java RE only and it didn't work, and I was scratching my head.
Java RE is what is suggested to you by default when you visit java.com. It is an easy mistake to make.
nalzok
The best thing about being a statistician is that you get to play in everyone's backyard.
Updated on July 16, 2022Comments
-
nalzok almost 2 years
I'm trying installing JDK on my Surface Pro 3, running 64-bit Windows 10.
As Authors of Core JAVA suggest, I installed JAVA at
C:\Java\jdk1.8.0_72\
, to avoid spaces in the path name. And I swear that I've installed a JDK(Downloaded from here), other than a JRE.However, after setting the environment variable
path
, I opened Command Prompt, enteredjavac -version
, and it told me'javac' is not recognized as an internal or external command, operable program or batch file.
. So I checkedC:\Java\jdk1.8.0_72\bin\
, and there is no executable file calledjavac.exe
!How can it be? And what I'm supposed to do now?
Here is the CMD output when I ran
dir
under thejdk\bin
:Microsoft Windows [版本 10.0.10240] (c) 2015 Microsoft Corporation. All rights reserved. C:\Users\sqy>cd C:\Java\jdk1.8.0_72\bin C:\Java\jdk1.8.0_72\bin>dir 驱动器 C 中的卷没有标签。 卷的序列号是 D611-8A7A C:\Java\jdk1.8.0_72\bin 的目录 2016/02/02 13:28 <DIR> . 2016/02/02 13:28 <DIR> .. 2016/02/02 13:28 1,182,304 awt.dll 2016/02/02 13:28 15,456 bci.dll 2016/02/02 13:28 <DIR> client 2016/02/02 13:28 142,944 dcpr.dll 2016/02/02 13:28 63,584 decora_sse.dll 2016/02/02 13:28 451,168 deploy.dll 2016/02/02 13:28 <DIR> dtplugin 2016/02/02 13:28 25,184 dt_shmem.dll 2016/02/02 13:28 21,600 dt_socket.dll 2016/02/02 13:28 109,152 eula.dll 2016/02/02 13:28 222,816 fontmanager.dll 2016/02/02 13:28 151,136 fxplugins.dll 2016/02/02 13:28 200,800 glass.dll 2016/02/02 13:28 400,992 glib-lite.dll 2016/02/02 13:28 514,656 gstreamer-lite.dll 2016/02/02 13:28 131,680 hprof.dll 2016/02/02 13:28 115,808 instrument.dll 2016/02/02 13:28 16,480 j2pcsc.dll 2016/02/02 13:28 51,296 j2pkcs11.dll 2016/02/02 13:28 19,552 jaas_nt.dll 2016/02/02 13:28 30,816 jabswitch.exe 2016/02/02 13:28 15,968 java-rmi.exe 2016/02/02 13:28 126,560 java.dll 2016/02/02 13:28 191,072 java.exe 2016/02/02 13:28 127,584 JavaAccessBridge.dll 2016/02/02 13:28 153,088 javacpl.cpl 2016/02/02 13:28 68,704 javacpl.exe 2016/02/02 13:28 57,440 javafx_font.dll 2016/02/02 13:28 444,000 javafx_font_t2k.dll 2016/02/02 13:28 126,048 javafx_iio.dll 2016/02/02 13:28 191,584 javaw.exe 2016/02/02 13:28 268,384 javaws.exe 2016/02/02 13:28 23,648 java_crw_demo.dll 2016/02/02 13:28 13,920 jawt.dll 2016/02/02 13:28 14,944 JAWTAccessBridge.dll 2016/02/02 13:28 163,936 jdwp.dll 2016/02/02 13:28 22,624 jfr.dll 2016/02/02 13:28 115,296 jfxmedia.dll 2016/02/02 13:28 33,926,240 jfxwebkit.dll 2016/02/02 13:28 15,968 jjs.exe 2016/02/02 13:28 158,816 jli.dll 2016/02/02 13:28 205,920 jp2iexp.dll 2016/02/02 13:28 77,920 jp2launcher.exe 2016/02/02 13:28 19,040 jp2native.dll 2016/02/02 13:28 173,152 jp2ssv.dll 2016/02/02 13:28 146,016 jpeg.dll 2016/02/02 13:28 16,480 jsdt.dll 2016/02/02 13:28 30,816 jsound.dll 2016/02/02 13:28 27,744 jsoundds.dll 2016/02/02 13:28 178,272 kcms.dll 2016/02/02 13:28 15,968 keytool.exe 2016/02/02 13:28 15,968 kinit.exe 2016/02/02 13:28 15,968 klist.exe 2016/02/02 13:28 15,968 ktab.exe 2016/02/02 13:28 185,952 lcms.dll 2016/02/02 13:28 33,376 management.dll 2016/02/02 13:28 574,560 mlib_image.dll 2016/02/02 13:28 455,328 msvcp120.dll 2016/02/02 13:28 773,968 msvcr100.dll 2016/02/02 13:28 970,912 msvcr120.dll 2016/02/02 13:28 79,968 net.dll 2016/02/02 13:28 51,296 nio.dll 2016/02/02 13:28 17,504 npt.dll 2016/02/02 13:28 16,480 orbd.exe 2016/02/02 13:28 15,968 pack200.exe 2016/02/02 13:28 <DIR> plugin2 2016/02/02 13:28 15,968 policytool.exe 2016/02/02 13:28 52,832 prism_common.dll 2016/02/02 13:28 116,832 prism_d3d.dll 2016/02/02 13:28 86,112 prism_sw.dll 2016/02/02 13:28 14,944 resource.dll 2016/02/02 13:28 15,968 rmid.exe 2016/02/02 13:28 15,968 rmiregistry.exe 2016/02/02 13:28 15,968 servertool.exe 2016/02/02 13:28 177,248 splashscreen.dll 2016/02/02 13:28 462,432 ssv.dll 2016/02/02 13:28 51,808 ssvagent.exe 2016/02/02 13:28 124,000 sunec.dll 2016/02/02 13:28 25,696 sunmscapi.dll 2016/02/02 13:28 193,120 t2k.dll 2016/02/02 13:28 16,480 tnameserv.exe 2016/02/02 13:28 65,632 unpack.dll 2016/02/02 13:28 159,328 unpack200.exe 2016/02/02 13:28 39,520 verify.dll 2016/02/02 13:28 21,600 w2k_lsa_auth.dll 2016/02/02 13:28 95,840 WindowsAccessBridge.dll 2016/02/02 13:28 164,448 wsdetect.dll 2016/02/02 13:28 69,728 zip.dll 85 个文件 46,209,264 字节 5 个目录 150,936,281,088 可用字节 C:\Java\jdk1.8.0_72\bin>
Yea, I'm a Chinese, so there are some Chinese characters in the output. I've changed the default language to English, and they remain. However, you will still be able to get the information you need, I suppose.
-
nalzok about 8 yearsSorry, there was a typo in my question. In fact, there is no
javac.exe
inC:\Java\jdk1.8.0_72\bin
. AndC:\Java\jdk1.8.0_72\bin
is already appended toPath
variable. -
aviad about 8 yearsWhat happens if you install different version of JDK? Can you also post the output of dir command when you run it from bin directory of jdk install location?
-
nalzok about 8 yearsI've just installed jdk1.8.0_71 instead, and same thing happened again.
-
nalzok about 8 yearsThere is no folder called
Java
under `C:\Program Files` on my device. During the installation, I've changed the target path twice. Have you done this? -
aviad about 8 yearsCould it be that when installer asked you where you want the JRE installed you pointed to the same dir where you told the installer to put JDK? In that case the installer will overwrite the content of bin of JDK by the content of bin of jre.
-
nalzok about 8 yearsThat's really possible, I'm going to try again.
-
Ekrem about 8 yearsi had changed it once. but i reinstalled it right now changing it twice. installer installs jdk to C:\Java but when installing jre it removes all the files and installs jre. I opened folder in windows and saw it :). So your jdk is removed by jre installer. I think you have to choose another folder when changing folder at first or second.
-
nalzok about 8 yearsOK, that's the problem.
-
aviad about 8 yearsNormally on this site if the answer was helpful, you accept it and not repost it as your own answer with some screenshots.
-
nalzok about 8 years@aviad Accepted. I just wanted to demonstrate your answers clearer