Menu

#35 DJL API in Robocode - getenv

none
closed
nobody
None
1
2022-08-06
2022-08-02
No

Hi Robocode Team,

I'd like to use the DJL API (https://djl.ai/) for a robot I'm building but it issues a call to getenv which is blocked by the security manager.

I know I can turn off the security manager using the -DNOSECURITY=true

but

(1) Does this mean that I will not be able to compete in tournaments?
(2) Is there any reason why the security manager would block the call to getenv?
(3) With Java 18 deprecating the security manager what are the future plans in this area?

Many thanks

Discussion

  • Flemming N. Larsen

    Hi Julien,
    I am surprised that the System.getenv is blocked by the security manager of Robocode.
    I think this is a mistake, and needs to be fixed. Hence, I will fix this with the next version of Robocode (very soon).

    1) As long as your robot can run with the security manager turned on, I guess you will be able to partifipate in any tournament, e.g. the LiteRumble

    2) I guess it is a mistake. The security manager in Robocode is provided to constrain the bots since they all run within the same Java Virtual Machine (JVM), and to avoid robots "cheating" or "hacking" other bots running.

    3) When a future Java does not contain the Security Manager anymore (it is still in Java 18), this will be a serious issue for Robocode. I am not sure the Permission framework is good enough for Robocode.
    At that time, it might be a good time to switch for Robocode Tank Royale, which is the new platform for Robocode. And I am working an creating a bridge for legacy robots to run in the new versions, even though the new version is not 100% compatible with the old for various reasons.

    I have no plans to fix current Robocode to run without the Security Manager. But if somebody else is up to it, please go ahead. 🙂

     

    Last edit: Flemming N. Larsen 2022-08-05
  • Flemming N. Larsen

    Regarding a robot being "banned" in Robocode. This is only true for the local robot.database (of a specific tournament).
    So you need to make sure that your robot can run with the security manager on your local system/machine. And if it gets banned locally, then just select the Options -> "clean robot cache" to allow your robot to run again. 🙂

     
    • Julien Norman

      Julien Norman - 2022-08-05

      Ok thanks Flemming , I've only just started using robocode again (after a long time away) and wasn't aware you guys had started work on a new version so I'll likely move over to Tank Royale, it seems to be a good improvement over robocode already.

       
      • Flemming N. Larsen

        Nice to have you back on Robocode. 😀👍

        If you want to participate in tournaments, the original Robocode is the way to go. Tank Royale does not have this yet.

         
  • Flemming N. Larsen

    • status: open --> closed
     
    • Julien Norman

      Julien Norman - 2022-08-06

      Many thanks Flemming.

       

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.