Hello,
after installing the newest version of robocode on my Mac (10.12.5) and execute the robocode.command following error appears:
Loaded net.sf.robocode.core
Loading plugins from /Users/*/robocode/libs
Loaded net.sf.robocode.battle
Loaded net.sf.robocode.host
Loaded net.sf.robocode.repository
Loaded net.sf.robocode.sound
Loaded net.sf.robocode.ui
Loaded net.sf.robocode.ui.editor
No robocode.properties. Using defaults.
java.lang.ExceptionInInitializerError
at net.sf.robocode.repository.RepositoryManager.reload(RepositoryManager.java:164)
at net.sf.robocode.ui.WindowManager.showSplashScreen(WindowManager.java:355)
at net.sf.robocode.core.RobocodeMain.run(RobocodeMain.java:129)
at java.base/java.lang.Thread.run(Thread.java:844)
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make field private static final java.util.HashMap sun.net.www.protocol.jar.JarFileFactory.fileCache accessible: module java.base does not "opens sun.net.www.protocol.jar" to unnamed module @7674e761
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:337)
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:281)
at java.base/java.lang.reflect.Field.checkCanSetAccessible(Field.java:175)
at java.base/java.lang.reflect.Field.setAccessible(Field.java:169)
at net.sf.robocode.io.URLJarCollector.<clinit>(URLJarCollector.java:48)
... 4 more</clinit>
I already searched for similar problems and tried the older version 1.9.2.5, but I got the same issues.
It's my first experience with Robocode. What can I do?
Thank you in advance.
Okay, I fixed the problem. I'm using two versions of Java (Jdk 8 and 9). Jdk 9 is causing the problems, so you have to switch the Jdk before execute the robocode.command. I created a shortcut for my terminal by using " alias setJdk8='export JAVA_HOME=$(/usr/libexec/java_home -v 1.8)' " and " setJdk8 ". Now it is running with Jdk 8 and you can execute robocode normally.
Thank you for reporting this issue, and especially the work-around, so other people will be able to see the solution.
I will keep an eye on the comming version of Java 9. It needs to be tested.
Fixed with the bugfix for Bug-391