getLocalRepository with .jar files

30 views
Skip to first unread message

Francisco Javier Erazo Palacios

unread,
Oct 6, 2022, 9:18:05 AM10/6/22
to Rococode Application Developers
Hi everyone.

I'm trying to get an instance of RobocodeEngine running. I've encountered a problem while trying to select the robots with the engine.getLocalRepository("sample.RamFire,sample.Corners") method since it doesn't detect my packed robots with JAR extension. I understand the args required are the class names separated by a comma but I'm not sure how to do that with JAR files. I'd also like to select packed robot teams as well.

Thanks in advance.
Message has been deleted
Message has been deleted

Flemming Larsen

unread,
Oct 6, 2022, 10:00:28 AM10/6/22
to Rococode Application Developers
I just tried this out to check that it still works for the RobocodeEngine for Robocode 1.9.4.7 running on Java 8 (should work on newer Java versions as well).

I just took some robots (from the LittleRumble) and put those robot jar archives into the robot folder of my robocode folder. I used acid.Bl4ck_1.0.jar attached in my answer. But you need to rename the file extension from .renamed into .jar (I could not attach a .jar file in this thread).

Even though the robot was not explicitly imported via the UI, the Robocode Engine detected it with:

engine.getLocalRepository("acid.Bl4ck,sample.Corners")

And I used the BattleRunner from the example on this page:
https://robocode.sourceforge.io/docs/robocode/robocode/control/package-summary.html

Perhaps something is wrong with the jar archive (e.g. missing a .properties file), or you do not write the package name of the robot class correctly?
(you can open the jar archive using a unzipper to see the content).

Are you spotting any error written out to the console that could explain the issue?

- - - -
By the way. The names provided for the getLocalRepository() method are actually package names as these are the names that the Robocode ClassLoader needs in order to load the bot classes. 🙂

acid.Bl4ck_1.0.renamed
Reply all
Reply to author
Forward
0 new messages