Help please!

50 views
Skip to first unread message

Farhan Sadique

unread,
Aug 6, 2024, 2:37:25 PM8/6/24
to Robocode
Capture1.PNG
I've made my 1st robot in IntelliJ idea but when I open robocode, this error message is shown. How to fix it?

fnl

unread,
Aug 6, 2024, 2:54:58 PM8/6/24
to Robocode
It is a very cryptic message at first. It seems that the robot your are trying to run has been compiled with Java class file version 65 which means Java 21.
But you are running the Robot on a Java version, the supports up to Java class file version 52 which means up to Java 8 (aka Java 1.8)

In short this means that you are probably running Robocode with Java 8 from inside IntelliJ, which does not support Java 21, which is many versions newer.
I recommend that you switch to a newer JDK (Java Developer Kit), which should be version 21 as minimum for running your robot.
You do this in IntelliJ from the menu: File -> Project Structure... -> Platform Settings / SDKs. Then you should "Add New SDK" by pressing the plus (+) symbol and select Download SDK and select version 21 (or newer) and choose e.g. Oracle OpenJDK 21, or alternatively Add SDK if you already have Java 21 or never installed somewhere on your system.

Alternatively, you can recompile your robot using an older Java version, e.g. Java 11, which is the minimum requirement for running the newest Robocode version.

I hope this helps? 🙂

Farhan Sadique

unread,
Aug 7, 2024, 10:55:21 AM8/7/24
to Robocode
I think this is the problem here.
Capture32.PNG

Farhan Sadique

unread,
Aug 7, 2024, 10:55:24 AM8/7/24
to Robocode
I've recompiled using Java 11 as you mentioned.Now the robot is shown with the package name in the robot list.But after selecting it,when I start the battle,my robot is not shown in game.

On Wednesday, August 7, 2024 at 12:54:58 AM UTC+6 fnl wrote:

fnl

unread,
Aug 7, 2024, 11:09:32 AM8/7/24
to Robocode
Please make sure you use the newest version of Robocode 1.9.5.2, as it contains a fix in set_java_options.sh/bat file run from robocode.sh/bat file that fixes this error, when you use Java 11 or newer:

@rem Only set 'java.security.manager=allow' for Java version > 11
if %JAVA_MAJOR_VERSION% GTR 11 set _JAVA_OPTIONS="-Djava.security.manager=allow"

Also make sure that you run Robocode by running the robocode.bat/sh file to ensure all Java options are setup correctly for both your system, and the specific Java version being used for running Robocode.
If you set the Java options yourself in IntelliJ, then add the  -Djava.security.manager=allow  in the the Java options of the launcher settings.

Make sure Robocode itself is running on at least Java 11. You can check this from the About box, which writes which Java version it run on.

If a robot will not run, then check the bot console by clicking its button on the right side of the battle view to see if error messages are printed out. If Robocode is running on an older Java version than the Java version used for compiling the bot, you will probably see an error in the console for the bot.

Write again, if you still got issues.

Farhan Sadique

unread,
Aug 7, 2024, 4:36:45 PM8/7/24
to Robocode
My issue is fixed now.Thank you very much!

fnl

unread,
Aug 7, 2024, 4:37:53 PM8/7/24
to Robocode
You are welcome. I am happy to hear that the issue was fixed.

What caused the issue?

Best regards,
- Flemming

Farhan Sadique

unread,
Aug 8, 2024, 8:25:54 AM8/8/24
to Robocode
Actually my JDK version wasn't up-to-date. Just updated it and changed the launcher settings as you mentioned. It worked!
Reply all
Reply to author
Forward
0 new messages