6

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)

TomateFraiche
  • 134
  • 1
  • 2
  • 11
  • I upvoted your question; I don't have an answer. Q: Why OpenJDK 11, instead of [Oracle JDK 11](https://www.oracle.com/technetwork/java/javase/downloads/)? – paulsm4 Oct 07 '18 at 17:21
  • 6
    If Windows can not find it on the path, you've set the path up wrong. There's nothing more complex about it than that. – Michael Oct 07 '18 at 17:23
  • 1
    OpenJDK has no installer. The JDK from Oracle still has. But when you want to switch from Oracle to OpenJDK, you should have de-installed the older version correctly, instead of just removing its folder. You very likely have `java` executables in the Windows installation, which try to determine the Java location via registry. – Holger Oct 08 '18 at 07:03
  • 2
    @paulsm4: The reason is usually that OracleJDK costs money starting 1st January 2019. – Robert Oct 08 '18 at 17:55
  • 3
    @paulsm4: Why OpenJDK? To finally leave the empire of Oracle and join the good kingdom of community-based Java. In other words, to not run a risk of having to pay for the thing that was free for 20 years – TomateFraiche Oct 08 '18 at 21:23
  • @Holger: uninstalling Java 9 was giving no results either. It finally turned out to be indeed the problem of my path :( – TomateFraiche Oct 08 '18 at 21:30
  • @Michael: In fact, it really was an in issue with my system path. My bad. I will delete my question soon and here is also a small explainer of what happened: I have multiple entries in the path and when I placed Java at the start of the path line, the expected change finally worked. Before that, Java address was at the end of the line, this way of path setting used to work for other software but it did not work for Java. – TomateFraiche Oct 08 '18 at 21:40
  • @TomateFraiche No harm done. Glad you got it sorted – Michael Oct 08 '18 at 22:02
  • From now and onward we will be seeing many post related to OpenJDK on stackoverflow. No oracle JDK for us now. – Umer Farooq Oct 09 '18 at 07:09

2 Answers2

4

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.

TomateFraiche
  • 134
  • 1
  • 2
  • 11
  • You should be able to make it work even with the Java directory at the end of the path. Your path probably has some other directories containing non-functioning files that are also called java/javac and because they come first in the path, they take precedence. Type WHERE JAVAC or WHERE JAVA to see which version actually gets picked up. – Klitos Kyriacou Oct 09 '18 at 06:45
  • All possible command line checks (included those you recommend) return the correct version. Plus, I already checked Java 11 new features and they worked alright, so it definitely works. Finally, you are right with your point about other files which include a word 'java' and take precedence over Java 11 is put at the end: in there I indeed have an entry called C:\Program Files (x86)\...\javapath. According to other SOverflow reponses, this gets added automatically during the installation of Java 8 (I need this one too) – TomateFraiche Oct 09 '18 at 18:47
  • Me too! I put it it at the beginning of the PATH variable and it works. – Laura Liparulo Dec 13 '18 at 20:44
1

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.
AlexP
  • 81
  • 4