My school got new computers. I was able to install Robocode on the old ones without issue. On the new computers, after installing, when I try to open it, the classic black box appears and disappears with the attached message. I have also posted the Java versions my computer has. Can anyone help?
Newer versions of Robocode has issues with running with Java 12 or newer unless this option is being used: -Djava.security.manager=allow
Robocode make use of the Security Manager in Java, which is now deprecated for removal. Hence, setting the java.security.manager to allow will make sure the Security Manager can still be used.
At least until it will be completely removed from Java. Unfortunately, it is not simple to remove the security manager of Robocode.
With the recent version of Robocode, the robocode.bat, robocode.sh, and robocode.command files has been updated. Now they include two set of command lines for starting Robocode. One of the lines is uncommented for older Java versions (prior to Java 12), while the other command line is not. So if you are running on older versions, you need to switch the uncommended line (@rem for robocode.bat).
You are welcome. I am happy that your issue is now resolved.
I can't find any information about when the Security Manager will be removed for good. I should like to know as well.
But I do know that lots of applications and IDE's out there will have big problems with replacing the Security Manager. I have no idea of how to do this the correct way for Robocode.
My school got new computers. I was able to install Robocode on the old ones without issue. On the new computers, after installing, when I try to open it, the classic black box appears and disappears with the attached message. I have also posted the Java versions my computer has. Can anyone help?
I tried running it in command prompt and got the longer version of the message... Is this because the computer is running Java 18? wasn't this fixed?
Newer versions of Robocode has issues with running with Java 12 or newer unless this option is being used:
-Djava.security.manager=allowRobocode make use of the Security Manager in Java, which is now deprecated for removal. Hence, setting the
java.security.managerto allow will make sure the Security Manager can still be used.At least until it will be completely removed from Java. Unfortunately, it is not simple to remove the security manager of Robocode.
With the recent version of Robocode, the robocode.bat, robocode.sh, and robocode.command files has been updated. Now they include two set of command lines for starting Robocode. One of the lines is uncommented for older Java versions (prior to Java 12), while the other command line is not. So if you are running on older versions, you need to switch the uncommended line (@rem for robocode.bat).
@REM Older than Java 12
java -Dsun.java2d.opengl=true -Xmx512M -cp "libs/" -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 %
@REM Java 12 and newer
@rem java -Dsun.java2d.opengl=true -Xmx512M -cp "libs/" -Djava.security.manager=allow -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 %
Oh I see, okay this seems to have worked. Thank you so much! How long do you think it will be until Java completely removes Security Manager for good?
You are welcome. I am happy that your issue is now resolved.
I can't find any information about when the Security Manager will be removed for good. I should like to know as well.
But I do know that lots of applications and IDE's out there will have big problems with replacing the Security Manager. I have no idea of how to do this the correct way for Robocode.
There is an article about JEP-411, which is about the deprecation for removal of the Security Manager:
https://foojay.io/today/why-jep-411-will-have-a-negative-impact-on-java-security/