-DNOSECURITY=true

69 views
Skip to first unread message

Gabriel Bonfim

unread,
May 8, 2023, 7:01:07 PM5/8/23
to Robocode
Hey guys, i have a problem kk

When i run robocode using -DNOSECURITY=true , i have this error message: "caused by: java.lang.classcastexception: class jdk.internal.loader.ClassLoaders$AppClassLoader cannot be cast to class java.net.URLClassLoader (jdk.internal.loader.ClassLoaders$AppClassLoader and java.net.URLClassLoader are in module java.base of loader 'boostrap').

Help. pls 

fnl

unread,
May 10, 2023, 2:34:19 PM5/10/23
to Robocode
I am able to reproduce this using Java 11. 
It seems to work fine under Java 8. So you can use Java 8 as a workaround until I got a fix for it in Robocode as it seems to be a bug.

The issue is caused by some internal classes in Java that have changed, which Robocode accesses. 

On Stack Overflow, people have seen similar issues with Spring Boot as well.

Thank you for reporting this. I will try to fix it with the next version of Robocode. 🙂👍

Best regards,
- Flemming N. Larsen

fnl

unread,
May 10, 2023, 2:35:47 PM5/10/23
to Robocode

fnl

unread,
May 10, 2023, 3:48:44 PM5/10/23
to Robocode
Hi again,

I made a fix that seems to work for me. This version has not been released yet, but it would be great to see if this version works for you?

Robocode 1.9.5.2 with fix:
https://robocode.sourceforge.io/files/robocode-1.9.5.2-setup.jar

Best regards,
- Flemming

Gabriel Bonfim

unread,
May 11, 2023, 12:36:52 AM5/11/23
to Robocode
hey, thanks for the reply. I run this new version, the -DNOSECURITY was accepted, but now i have this error.
robocode does not load the robots.

thank you for your support 
Sem título111.png

Gabriel Bonfim

unread,
May 11, 2023, 12:36:56 AM5/11/23
to robo...@googlegroups.com
hey, thanks for the reply, i'll test this version and get back to you.

att.

--
You received this message because you are subscribed to a topic in the Google Groups "Robocode" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/robocode/4KZ0KgCxbvE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to robocode+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/robocode/23099408-8c36-4a6a-8aa7-372f870c44abn%40googlegroups.com.

fnl

unread,
May 11, 2023, 10:23:19 AM5/11/23
to Robocode
Thank you for the heads up. I will have to come up with a better fix for this one.
In the meantime, you'll need to stick with Java 8 when using the `-DNOSECURITY=true` option, which is not optimal.

fnl

unread,
May 11, 2023, 10:53:35 AM5/11/23
to Robocode
Okay. I think I found the problem. It is not possible to let Robocode add the `robots` folder to the system classpath anymore programmatically since Java 9.
However, we can still add it to the ordinary classpath when running Robocode from the CLI. And we already did this previously with Robocode, but removed it with the recent script changes.

So I have reintroduced putting the `robots` directory on the classpath for all scripts used for running Robocode, RoboRumble etc.

Here is a new version "1.9.5.2" containing the new fix:
https://robocode.sourceforge.io/files/robocode-1.9.5.2-setup.jar

I cross my fingers that this works for you as well when adding the `-DNOSECURITY=true` option.
Reply all
Reply to author
Forward
0 new messages