Menu

Problem of version when starting robocode with java

Help
2018-11-28
2018-11-29
  • Pierre-Yves

    Pierre-Yves - 2018-11-28

    Hi,

    I have a project with robocode and java. There is a class to easily start robocode and test the robot in it. It is several years old and I successfully used it many times, but now, it stopped working. I have no idea why (it speaks about versions, I followed the log on github but that wasn't useful).
    Could you help me ?

    Here is the class that calls robocode :

    package controller;
    
    import java.io.IOException;
    
    public class TestBattle {
    
        public static void main(String[] args) {
            String ROBOCODE_PATH = "libs/robocode.jar";
            String BATTLE_PATH = "data/test.battle";
            try {
                // Launch the test in Robocode
                Runtime.getRuntime().exec("java -Xmx512M -DNOSECURITY=true -DWORKINGDIRECTORY=data -cp "
    
                        + ROBOCODE_PATH + " robocode.Robocode -nosound -battle " + BATTLE_PATH).waitFor();
            } catch (IOException | InterruptedException e) {
                e.printStackTrace();
            }
        }
    
    }
    

    And here is the "main battle log" from Robocode :

    Warning: Robocode is running without a security manager.
    Robots have full access to your system.
    You should only run robots which you trust!
    Update checking with http.
    java.lang.IllegalArgumentException: The format of the version string is not a valid
        at net.sf.robocode.version.Version.<init>(Version.java:32)
        at net.sf.robocode.version.Version.compare(Version.java:167)
        at net.sf.robocode.ui.dialog.RobocodeFrame.checkForNewVersion(RobocodeFrame.java:172)
        at net.sf.robocode.ui.dialog.RobocodeFrame.checkUpdateOnStart(RobocodeFrame.java:158)
        at net.sf.robocode.ui.WindowManager.showRobocodeFrame(WindowManager.java:155)
        at net.sf.robocode.core.RobocodeMain.run(RobocodeMain.java:131)
        at java.base/java.lang.Thread.run(Thread.java:844)
    

    Thanks

     

    Last edit: Pierre-Yves 2018-11-28
    • Flemming N. Larsen

      Hi,

      I believe this is due to a problem with the newest version of Robocode
      (1.9.3.3). I fixed a problem with "java.lang.IllegalArgumentException: The
      format of the version string is not a valid", which is currently available
      in a beta version for the next version 1.9.3.4 coming out soon. In the
      meanwhile, it is quite safe to use the beta available from here:
      https://robocode.sourceforge.io/files/robocode-1.9.3.4-Beta-2-setup.jar

      I expect that will work. :-)

      Cheers,

      • Flemming

      Den ons. 28. nov. 2018 kl. 17.11 skrev Pierre-Yves asimonu@users.sourceforge.net:

      Hi,

      I have a project with robocode and java. There is a class to easily start
      robocode and test the robot in it. It is several years old and I
      successfully used it many times, but now, it stopped working. I have no
      idea why (it speaks about versions, I followed the log on github but that
      wasn't useful).
      Could you help me ?

      Here is the class that calls robocode :

      package controller;
      import java.io.IOException;
      public class TestBattle {

      public static void main(String[] args) {
          String ROBOCODE_PATH = "libs/robocode.jar";
          String BATTLE_PATH = "data/test.battle";
          try {
              // Launch the test in Robocode
              Runtime.getRuntime().exec("java -Xmx512M -DNOSECURITY=true -DWORKINGDIRECTORY=data -cp "
                      + ROBOCODE_PATH + " robocode.Robocode -nosound -battle " + BATTLE_PATH).waitFor();
          } catch (IOException | InterruptedException e) {
              e.printStackTrace();
          }
      }
      

      }

      And here is the error log :

      Warning: Robocode is running without a security manager.Robots have full access to your system.You should only run robots which you trust!Update checking with http.java.lang.IllegalArgumentException: The format of the version string is not a valid
      at net.sf.robocode.version.Version.<init>(Version.java:32)
      at net.sf.robocode.version.Version.compare(Version.java:167)
      at net.sf.robocode.ui.dialog.RobocodeFrame.checkForNewVersion(RobocodeFrame.java:172)
      at net.sf.robocode.ui.dialog.RobocodeFrame.checkUpdateOnStart(RobocodeFrame.java:158)
      at net.sf.robocode.ui.WindowManager.showRobocodeFrame(WindowManager.java:155)
      at net.sf.robocode.core.RobocodeMain.run(RobocodeMain.java:131)
      at java.base/java.lang.Thread.run(Thread.java:844)</init>

      Thanks

      Problem of version when starting robocode with java
      https://sourceforge.net/p/robocode/discussion/116459/thread/97bc0838b5/?limit=25#1a1d


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/robocode/discussion/116459/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       
      • Pierre-Yves

        Pierre-Yves - 2018-11-29

        That worked, thanks a lot !

         

Log in to post a comment.