Open Jayzijun opened 10 months ago
Unable to make protected final java.lang.Class java.lang.ClassLoader.defineclass
What version of MATSim are you using? What Java version are you using?
I think we had similar error messages with older versions of MATSim on very new Java versions. I think the latest MATSim version should work well with Java 17, so maybe give that combination a try.
Hi @mrieser,
my current Java version is 17.0.7; Private Build; mixed mode, sharing; 64-bit and my MATSim version is Build: ra5d8c2fe629e3d2a2302c2276f7ea6cdc631c641 (2023-02-08 21:47:36)
I would think that the problem would come from the code since I was able to run the example simulation. However, now that you have brought up the topic of software versions, could it be that my current version of my MATSim is unable to work with Java 17?
Java 17 should actually be okay. In the past, we had issues with very new java versions, but that should not be the case here.
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make protected final java.lang.Class java.lang.ClassLoader.defineclass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) throws java.lang.ClassFormatError accessible: module java.base does not “opens java.lang” to unnamed module @34252efb
The error message states something about modules.
How do you start MATSim? What command do you exactly use?
Searching for the above error message suggests adding --add-opens=java.base/java.lang=ALL-UNNAMED
when starting MATSim, e.g. something like this:
java -Xmx4g --add-opens=java.base/java.lang=ALL-UNNAMED -jar matsim.jar org.matsim.run.Controler myConfig.xml
Hi @mrieser,
When I start MATSim, I use the command java -jar matsim-spatialDRT_noav_gradual.jar
I have also tried the method that you have provided but it still has the same errors. Perhaps I did not key it in correctly?
The format that i used was java -Xmx4g --add-opens=java.base/java.lang=ALL-UNNAMED -jar matsim-spatialDRT_noav_gradual.jar org.matsim.run.Controler defaultConfig.xml
Hello, I am a beginner in MATSim and I have tried out the matsim-example-project and it works perfectly fine. However when trying to run a different scenario, I have encountered a long string of errors which I am not sure how to solve. I also do not know much about Java so there would be a need for guidance in this part too.
Here are the warnings & errors:
Open to suggestions and assistances. Thanks.