Closed lostiniceland closed 1 year ago
So the shell version should look like this (when running a newer Java)
java --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/sun.nio.ch=ALL-UNNAMED $JQASSISTANT_OPTS -jar "$JQASSISTANT_HOME/lib/com.buschmais.jqassistant.cli-jqassistant-commandline-neo4jv3-1.10.0.jar" "$@"
I've faced the same issue in the maven-plugin. Adding the above add-opens to the JVM args solved it.
Bitten by this as well. I see this in a Maven run on a JDK 16:
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make field private java.lang.String java.lang.Throwable.detailMessage accessible: module java.base does not "opens java.lang" to unnamed module @16d431b4
at java.lang.reflect.AccessibleObject.checkCanSetAccessible (AccessibleObject.java:357)
at java.lang.reflect.AccessibleObject.checkCanSetAccessible (AccessibleObject.java:297)
at java.lang.reflect.Field.checkCanSetAccessible (Field.java:177)
at java.lang.reflect.Field.setAccessible (Field.java:171)
at org.neo4j.helpers.Exceptions.<clinit> (Exceptions.java:413)
at org.neo4j.kernel.NeoStoreDataSource.start (NeoStoreDataSource.java:433)
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start (LifeSupport.java:452)
at org.neo4j.kernel.lifecycle.LifeSupport.start (LifeSupport.java:111)
at org.neo4j.kernel.impl.transaction.state.DataSourceManager.start (DataSourceManager.java:116)
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start (LifeSupport.java:452)
at org.neo4j.kernel.lifecycle.LifeSupport.start (LifeSupport.java:111)
at org.neo4j.graphdb.facade.GraphDatabaseFacadeFactory.initFacade (GraphDatabaseFacadeFactory.java:227)
at org.neo4j.graphdb.facade.GraphDatabaseFacadeFactory.newFacade (GraphDatabaseFacadeFactory.java:148)
at org.neo4j.graphdb.factory.GraphDatabaseFactory.newDatabase (GraphDatabaseFactory.java:133)
at org.neo4j.graphdb.factory.GraphDatabaseFactory.newEmbeddedDatabase (GraphDatabaseFactory.java:122)
at org.neo4j.graphdb.factory.GraphDatabaseFactory$EmbeddedDatabaseCreator.newDatabase (GraphDatabaseFactory.java:178)
at org.neo4j.graphdb.factory.GraphDatabaseBuilder.newGraphDatabase (GraphDatabaseBuilder.java:210)
Looks like this is ultimately caused by Neo4j trying to make Throwable.detailMessage
accessible, which looks a bit adventurous in the first place.
This is indeed caused by Neo4j. With the migration to jQAssistant 2.0, comes Neo4j v4, where you'll see similar issues e.g. in JDK 17. This is also documented: https://jqassistant.github.io/jqassistant/doc/2.0.0/manual/
When trying to run jqassistant cli with Java 16 I get the following error
Solution: As a solution the script must add the following options to the java command
--add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/sun.nio.ch=ALL-UNNAMED