On Windows 10, I successfully changed my java version to JDK 1.8:
C:\Users\Boommeister69>java -version
java version "1.8.0_261"
Java(TM) SE Runtime Environment (build 1.8.0_261-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.261-b12, mixed mode)
but javac doesn't change:
C:\Users\Boommeister69>javac -version
javac 11.0.7
when I echo %PATH%
this is the result:
C:\Users\Boommeister69>echo %PATH%
C:\Program Files (x86)\Common Files\Oracle\Java\javapath;
C:\Program Files\AdoptOpenJDK\jdk-11.0.7.10-hotspot\bin;
C:\Python38\Scripts\;C:\Python38\;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)\NVIDIA Corporation\PhysX\Common;
C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;
C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;
C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;
C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;
C:\Program Files\nodejs\;C:\ProgramData\chocolatey\bin;
C:\Program Files\Amazon\AWSCLIV2\;C:\Program Files (x86)\QuickTime\QTSystem\;C:\Program Files\Git\cmd;C:\Program Files\MariaDB 10.5\bin;
C:\Program Files\Java\jdk1.8.0_261\bin;
C:\Program Files\PuTTY\;C:\Program Files\CMake\bin;C:\Program Files\Amazon\AWSSAMCLI\bin\;
C:\Program Files\Java\jdk1.8.0_261\bin;
C:\Users\Boommeister69\AppData\Local\Microsoft\WindowsApps;C:\Users\Boommeister69\AppData\Roaming\npm;
C:\Users\Boommeister69\AppData\Local\Temp\apache-maven-3.6.3-bin\apache-maven-3.6.3\bin;
C:\Program Files\heroku\bin;
C:\workspace\play-samples-play-java-hello-world-tutorial;C:\Program Files\Maven\apache-maven-3.6.3\bin;
C:\Users\Boommeister69\AppData\Local\Programs\Microsoft VS Code\bin;C:\Program Files\Docker Toolbox;
So I have 3 paths showing up there with Java JDKs, the first JDK path is still set to Java 11. I think this is the problem, but I don't know how to change this? And why are there so many paths showing up, shouldn't echo %PATH%
only return the system environment path variables?
These are my system environment path variables:
and my JAVA_HOME variable:
I also changed the SDK in my IntelliJ, altough I don't think this has something to do with javac:
Ok I found a dirty solution:
I just removed the whole folder of my JDK 11 C:\Program Files\AdoptOpenJDK\jdk-11.0.7.10-hotspot