I'm working on an evolution project which will create bots, compile them, then create a robocode engine to perform battles between the bots. The bots do need to read from a file outside their local directory, so that's why I think it may be a security issue.
The bots are compiling correctly, and will run if robocode is launched from eclipse. The VM arguments in eclipse do disable the security.
However, creating a battle using a java program yields the following error:
java.lang.ClassNotFoundException: net.sf.robocode.core.RobocodeMainBase
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at net.sf.robocode.security.HiddenAccess.init(HiddenAccess.java:86)
at net.sf.robocode.security.HiddenAccess.initContainerForRobotEngine(HiddenAccess.java:246)
at robocode.control.RobocodeEngine.init(RobocodeEngine.java:138)
at robocode.control.RobocodeEngine.<init>(RobocodeEngine.java:72)
at testRobocodeEngine.BattleRunner.main(BattleRunner.java:21)</init>
Can't find robocode.core-1.x.jar module near to robocode.jar
The compiling is being done with java jdk 1.8.0_121.
The about section of robocode says it is using Java 1.8.0_181.
Thank you!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I believe it is a class-path issue. ClassNotFoundException is thrown by the JVM when it cannot find the class on the class-path.
When running your RobocodeEngine, you need to add [robocode home dir]/libs on your classpath in order for java to locate robocode.jar and the rest of the jar files it depends on.
Last edit: Flemming N. Larsen 2019-04-12
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I'm working on an evolution project which will create bots, compile them, then create a robocode engine to perform battles between the bots. The bots do need to read from a file outside their local directory, so that's why I think it may be a security issue.
The bots are compiling correctly, and will run if robocode is launched from eclipse. The VM arguments in eclipse do disable the security.
However, creating a battle using a java program yields the following error:
java.lang.ClassNotFoundException: net.sf.robocode.core.RobocodeMainBase
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at net.sf.robocode.security.HiddenAccess.init(HiddenAccess.java:86)
at net.sf.robocode.security.HiddenAccess.initContainerForRobotEngine(HiddenAccess.java:246)
at robocode.control.RobocodeEngine.init(RobocodeEngine.java:138)
at robocode.control.RobocodeEngine.<init>(RobocodeEngine.java:72)
at testRobocodeEngine.BattleRunner.main(BattleRunner.java:21)</init>
The compiling is being done with java jdk 1.8.0_121.
The about section of robocode says it is using Java 1.8.0_181.
Thank you!
I believe it is a class-path issue. ClassNotFoundException is thrown by the JVM when it cannot find the class on the class-path.
When running your RobocodeEngine, you need to add [robocode home dir]/libs on your classpath in order for java to locate robocode.jar and the rest of the jar files it depends on.
Last edit: Flemming N. Larsen 2019-04-12
That did the trick. Including all the Robocode libs in the classpath solved it. Thank you!
Good to hear. I am glad you made it work. :-)
Den lør. 13. apr. 2019 kl. 07.02 skrev Justin Long jlong1005@users.sourceforge.net: