Hey guys, I have used robocode for one of my course projects and I am running into an issue.
TL;DR: Not able to load any robot from the robot database (robots/) when -DNOSECURITY is set to true.
OS: macOS Monterey Version 12.3.1
Robocode Version: 1.9.4.7 (05-Aug-2022)
JDK:
openjdk version "1.8.0_352"
OpenJDK Runtime Environment (Zulu 8.66.0.15-CA-macos-aarch64) (build 1.8.0_352-b08)
OpenJDK 64-Bit Server VM (Zulu 8.66.0.15-CA-macos-aarch64) (build 25.352-b08, mixed mode)
Description:
I was trying to disable the security manager since I have third-party dependencies (slf4j, nd4j) for my robot and need additional access. However, when I try pass in the additional argument -DNOSECURITY = true to the start up argument provided in robocode.command like following
java -Xdock:icon=robocode.ico -Xdock:name=Robocode -Xmx512M -cp "libs/*" -DNOSECURITY=true -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 $*
, robocode failed to read any robot files. Those files was successfully read if there is no -DNOSECURITY or -DNOSECURITY=false. The error log shows java.lang.ClassNotFoundException for each robots like this: Got an error with sampleteam.MyFirstLeader: java.lang.ClassNotFoundException: sampleteam.MyFirstLeader.