I'm trying to start Robocode from a Java project in Eclipse using RobocodeEngine, but everytime I try it fails with the following:
java.lang.ClassNotFoundException: net.sf.robocode.core.RobocodeMainBase
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:471)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
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 prueba.RouteFinder.main(RouteFinder.java:40)
Can't find robocode.core-1.x.jar module near to robocode.jar
Class path: /home/rober/Documentos/robocode/Robocode/bin:/opt/robocode/libs/robocode.jar
Which is stupid because robocode.core-.jar, is exactly in the location it is looking for robocode.jar (/opt/robocode/libs), so it has to be a bug.
Information
Robocode does not support Java 11 yet.
That said, you should be able to get the RobocodeEngine up and running on Java 11. I just did that.
You "just" need to add all the jar files under /libs to your class path.
Newer Java versions require you to explicitly add which jars and modules you need for your application. You can leave out roborumble.jar. If you don't use the Robocode UI, you can leave out those jar files as well.
Last edit: Flemming N. Larsen 2019-05-12
You are right, adding the .jar files "fixed" it. I think it should be added to the wiki http://robowiki.net/wiki/Robocode/Eclipse/Create_a_Project
I will definitely update the Javadoc for the RobocodeEngine with this information. However, an ordinary robot project only needs robocode.jar, which includes "only" the Robot API. :-)
Last edit: Flemming N. Larsen 2019-05-13