Install Java 11 OpenJDK on Windows (a system path

2020-07-16 02:26发布

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)

标签: java java-11
2条回答
地球回转人心会变
2楼-- · 2020-07-16 02:59

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.
查看更多
乱世女痞
3楼-- · 2020-07-16 03:03

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.

查看更多
登录 后发表回答