-2

I installed jre1.8.0_211 (first) and jdk-12.0.1.

My Environment Variables:

JAVA_HOME
C:\Program Files\Java\jdk-12.0.1

CLASSPATH
;%JAVA_HOME%\lib;%JAVA_HOME%\lib\tools.jar;%JAVA_HOME%\lib\dt.jar;
%JAVA_HOME%\lib\htmlconverter.jar;%JAVA_HOME%\jre\lib;%JAVA_HOME%\jre\lib\rt.jar;

Path
;%JAVA_HOME%\bin

Apparently it's set up correctly, but it still doesn't work.

javac in Command Prompt results in:

'javac' is not recognized as an internal or external command,
operable program or batch file.

Although java works correctly.

Can someone help me set up correctly?

Alec
  • 8,529
  • 8
  • 37
  • 63
  • 1
    You probably aren't quoting things correctly. Show us how you've set those environment variables. – Elliott Frisch Apr 21 '19 at 03:27
  • If you run `java -version`, does it say Java 8 or Java 12? – Andreas Apr 21 '19 at 04:45
  • 2
    Also you shouldn't need to put any of those things on the CLASSPATH. – Stephen C Apr 21 '19 at 05:14
  • Can you run echo %JAVA_HOME% and see what it returns ? – royalghost Apr 21 '19 at 05:15
  • 2
    You shouldn't have to do any of this. I haven't messed around with environment variables after a Java install for 20 years, except for other things like Netbeans and Tomcat. – user207421 Apr 21 '19 at 05:15
  • If you are not able to find out resolution, try to install NetBeans8.2 , It came with all required things to run java and your environment will be set as well. :) –  Apr 21 '19 at 05:24
  • possibly helpful or related [Java 1.8.65 javac is missing](http://stackoverflow.com/questions/34559379/java-1-8-65-javac-is-missing), [javac.exe not found in JDK 1.8](http://stackoverflow.com/questions/33943592/javac-exe-not-found-in-jdk-1-8) – chickity china chinese chicken Apr 21 '19 at 06:39