I just tried installing Robocode tonight. I am on Java SE 21.0.1. I did as much debugging regarding Java's Security Manager as I could, but I'm getting an UnsupportedOperationException.
Not sure what else I can do, but I would appreciate any help if you are able to offer it. I'm on MacOS Catalina 10.15.5.
The java.security.manager property must be set to true which can be achieved by setting _JAVA_OPTIONS="-Djava.security.manager=allow" with the Java command when starting Robocode.
With newer versions of Robocode, e.g. 1.9.5.2, you should not need to set this as this is set automatically when starting Robocode with the robocode.sh script, which calls the set_java_options.sh script, which again sets the above command.
So if this is not working, I recommend you hardcode this in the robocode.sh file by replacing the java command section with this part:
# Run Robocode
java\-cp"libs/*"\-Djava.security.manager=allow\-Xmx512M\-Xdock:name=Robocode\-Xdock:icon=robocode.ico\-XX:+IgnoreUnrecognizedVMOptions\"--add-opens=java.base/sun.net.www.protocol.jar=ALL-UNNAMED"\"--add-opens=java.base/java.lang.reflect=ALL-UNNAMED"\"--add-opens=java.desktop/javax.swing.text=ALL-UNNAMED"\"--add-opens=java.desktop/sun.awt=ALL-UNNAMED"\robocode.Robocode"$@"
I hope this helps?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hey Flemming!
I just tried installing Robocode tonight. I am on Java SE 21.0.1. I did as much debugging regarding Java's Security Manager as I could, but I'm getting an UnsupportedOperationException.
Not sure what else I can do, but I would appreciate any help if you are able to offer it. I'm on MacOS Catalina 10.15.5.
Thank you!
The
java.security.managerproperty must be set totruewhich can be achieved by setting_JAVA_OPTIONS="-Djava.security.manager=allow"with the Java command when starting Robocode.With newer versions of Robocode, e.g. 1.9.5.2, you should not need to set this as this is set automatically when starting Robocode with the
robocode.shscript, which calls theset_java_options.shscript, which again sets the above command.So if this is not working, I recommend you hardcode this in the
robocode.shfile by replacing the java command section with this part:I hope this helps?