Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Install Java 11 OpenJDK on Windows (a system path issue)

Tags:

java

java-11

Java 11 had recently arrived and, as everybody knows, this version has no installation file.

To install Java without installer I, of course, had set my system settings PATH and JAVA HOME to the address of the folder where my Java 11 was unzipped (advised by accepted reponses to similar questions).

The only thing is that all those advices about system settings make no effect whatsoever on my machine:

  • Checking with a command line outputs my old Java 9 version
  • With Java 9 removed from the folder, command line does not recognise any Java at all.

So, is there actually any way to install this version?

Thanks for future answers and for not marking my question as a duplicate (for the reason explained above)

like image 922
TomateFraiche Avatar asked Oct 07 '18 17:10

TomateFraiche


2 Answers

The problem resided in the format of the path line:

  1. My path included multiple entries, I was putting Java at the end of the line and the change was not working

  2. But when I placed it right at the start of the path line, Java 11 got accepted and started to function alright on my Windows.

For other users facing a similar issue: The root of the problem was that, as Klitos Kyriacou rightly pointed out, my path included other entries that had a word 'java' in their names. When placed before Java 11 in the classpath, those entries were invalidating my adding of the java version.

like image 77
TomateFraiche Avatar answered Oct 17 '22 22:10

TomateFraiche


Looks like Oracle uninstaller does not clean up everything.
Even after uninstalling all old jdk/jre and installing OracleJDK 11, my system still has "C:\ProgramData\Oracle\Java\javapath" folder and "C:\ProgramData\Oracle\Java\javapath" entry in PATH.
Because of that when I run "java -version" I get:

C:\>java -version
Error: opening registry key 'Software\JavaSoft\JRE'
Error: could not find java.dll
Error: Could not find Java SE Runtime Environment.
like image 45
AlexP Avatar answered Oct 17 '22 22:10

AlexP