I am using java 12.0.2, JAVA_HOME
is set as C:\Program Files\Java\jdk-12.0.2
and PATH
is having %JAVA_HOME%\bin
still when I try executing java
command its giving me the error 'java' is not recognized as an internal or external command, operable program or batch file.
java
and javac
are part of JRE
and JDK 12
doesn't have JRE
now, so how to setup this.
please don't relate this issue with old questions, until java8 it's fine but its not working now in windows 10.
3 Answers
java and javac are part of JRE and JDK 12 doesn't have JRE now, so how to setup this.
After JDK 10, there is no separate JRE shipped and you do not need a separate JRE anymore. The JDK is enough.
I am using java 12.0.2, JAVA_HOME is set as C:\Program Files\Java\jdk-12.0.2 and PATH is having %JAVA_HOME%\bin
The space in the path may cause problems. I suggest you set C:\Program Files\Java\jdk-12.0.2\bin
directly into PATH
. Also, make sure to promote this entry to the top (beginning) so that this entry overrides the existing Java version (if any).
Last but not the least, start a new cmd window session to check java -version
because the changes in the environment variables using the GUI does not become effective in already open cmd windows.
For any misconfiguration, if you can not make it work, download a fresh JDK and follow the instructions on the download page.
The problem was caused by Python which was not allowing to execute java/javac commands. Once I uninstall the python everything worked fine.
I am still not sure what happened when I install Python as I explicitly didn't do anything except enabling the tick mark to setup the path variable while installing it.
PATH
management, not Java. I would first check thatjava
is in%JAVA_HOME%\bin
and then that this is really in thePATH
that is in effect where you are trying to run it. We need more details about the environment you're having problems with. - asm