Currently my Java version is 17. Neo4j requires me to install Java 11 or OpenJDK 11, or else it will give the error java.lang.IllegalAccessException: module java.base does not open java.nio to unnamed module @1817d444
. I guess I need to downgrade to JDK 11.
Java Platform, Standard Edition 11 Reference Implementations is the only place I can get JDK 11. However it seems to be a binary, not a setup. Checking C:\Program Files\Java
I found a folder for jdk-17 and jre1.8.0, so I copy the folder jdk-11 I just download to there. Checking the path environment I see these two lines:
C:\Program Files\Common Files\Oracle\Java\javapath
C:\Program Files (x86)\Common Files\Oracle\Java\javapath
Checking the javapath for 64-bit I see that there are java.exe, javac.exe, javaw.exe, jshell.exe. Does that mean that I should replace those files with the ones from jdk-11?
--illegal-access=permit
anymore. However, you could still make the access possible using--add-opens java.base/java.nio=ALL-UNNAMED
, without the need to switch to an older JDK. Of course, in the long term, there will be no cure for software whose vendors insist on doing illegal accesses even after they learned about the encapsulation goal. – Mathias