neo4j-gremlin not working with JDK17

Neo4jGraph fails to start with top-level error like:
Error starting org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory
with causes like:
Suppressed: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.kernel.impl.scheduler.CentralJobScheduler@5906ebfb' failed to transition from stopped to shutting_down. Please see the attached cause exception "Exception java.lang.LinkageError: Could not get Throwable message field [in thread "main"]"
and:
Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.kernel.NeoStoreDataSource@4bfe83d' was successfully initialized, but failed to start. Please see the attached cause exception "Exception java.lang.IllegalAccessError: class org.neo4j.io.pagecache.impl.SingleFilePageSwapper (in unnamed module @0x75eeccf5) cannot access class sun.nio.ch.FileChannelImpl (in module java.base) because module java.base does not export sun.nio.ch to unnamed module @0x75eeccf5 [in thread "main"]".
Solution
This issue relates back to: https://tinkerpop.apache.org/docs/current/upgrade/#_building_and_running_with_jdk_17 and the need to add this JVM option:
--add-opens=java.base/sun.nio.ch=ALL-UNNAMED
Was this page helpful?