Robocode reading robot database failed when -DNOSECURITY=true

61 views
Skip to first unread message

Tao Ma

unread,
Nov 28, 2022, 1:35:51 AM11/28/22
to Robocode
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.



fnl

unread,
Nov 28, 2022, 4:18:42 AM11/28/22
to Robocode
Thank you for reporting this.

I have tried this out myself, and I see you are right meaning that we get a  ClassNotFoundException when  -DNOSECURITY=true

I will have a look into this and see if I can make a good fix for it (within a week - no promise?). I will create a new version of Robocode, if/when I succeed. 🙂

Best regards,
- Flemming N. Larsen

Reply all
Reply to author
Forward
0 new messages