Menu

Security issue or compile issue

Help
2019-04-12
2019-04-13
  • Justin Long

    Justin Long - 2019-04-12

    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>

    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!

     
  • Flemming N. Larsen

    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

Log in to post a comment.

Auth0 Logo