Menu

Problems to build Robocode

Help
NPS
2015-07-06
2015-07-21
  • NPS

    NPS - 2015-07-06

    Hi everyone!

    I need to use Robocode as a movement simulator tool for my academic project. The first step I need to do is to change some values of Rules.java constants. To build the modified solution, I've downloaded the source from GitHub as a .zip file, run mvnassembly command from terminal (Ubuntu) and now I don't know what is the next step. I think this article from Robowiki is not clear for me: http://robowiki.net/wiki/Robocode/Developers_Guide_for_building_Robocode#How_to_build_distribution_files.3F. I mean, how can I install and run Robocode after built it?

    Need help!

     

    Last edit: NPS 2015-07-06
  • Flemming N. Larsen

    If you are able to build Robocode using mvnassembly without any error, you'll have the distribution files used for installing Robocode under the directory [robocode workspace]/robocode.distribution/target. You should look for the robocode-setup-x.x.x.x.jar file like e.g. robocode-1.9.2.4-setup.jar.

    When using a shell/command-prompt standing in the /robocode.distribution/target directory, you can install Robocode by writting this in the prompt:

    java -jar robocode-1.9.2.4-setup.jar

    You should see the installation program prompting you for where to install Robocode. After having installed Robocode, you just open the directory containing Robocode and double-click robocode.bat (on Windows), robocode.command (for Mac OS X), or robocode.sh (for Linux/Unix-like).

    I hope this helps?

     
  • NPS

    NPS - 2015-07-08

    Hi Flemming! Thanks for the answer!

    Actually I've got some errors and BUILD FAILURE by calling mvnassembly command. The results are below. Then neither target diretory nor the .jar files were found under [robocode workspace]/robocode.distribution/...

    I set JAVA_HOME parameter and checked if JDK 6 was installed and set as default. How can I proceed?

    Results :

    Failed tests: run(net.sf.robocode.test.robots.TestInteruptibleEvent)
    run(net.sf.robocode.test.robots.TestFileAttack): Didn't seen preventing read
    run(net.sf.robocode.test.robots.TestPosition): (..)
    run(net.sf.robocode.test.robots.TestDuplicatesAndScore): (..)
    run(net.sf.robocode.test.robots.TestCustomEvents): Number of errors 1 is different than expected 0(..)
    run(net.sf.robocode.test.robots.TestJunior): Number of errors 1 is different than expected 0(..)
    run(net.sf.robocode.test.robots.TestThreadGroupAttack)
    run(net.sf.robocode.test.robots.TestRandom): Number of errors 196 is different than expected 0(..)
    run(net.sf.robocode.test.robots.TestWin): (..)
    run(net.sf.robocode.test.robots.TestWatchBullet): Number of errors 4 is different than expected 0(..)

    Tests run: 52, Failures: 10, Errors: 0, Skipped: 3

    [INFO] ------------------------------------------------------------------------
    [ERROR] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] There are test failures.

    Please refer to /home/xxx/robocode-master/robocode.tests/target/surefire-reports for the individual test results.
    [INFO] ------------------------------------------------------------------------
    [INFO] For more information, run Maven with the -e switch
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 1 minute 52 seconds
    [INFO] Finished at: Wed Jul 08 19:14:35 BRT 2015
    [INFO] Final Memory: 60M/596M
    [INFO] ------------------------------------------------------------------------

     

    Last edit: NPS 2015-07-08
  • NPS

    NPS - 2015-07-09

    I proceeded exactly in Windows 8 and I've got the same build failure as shown in this print screen: https://www.dropbox.com/s/s5p94939dxy1yje/build-failure-robocode.png?dl=0

     
  • Flemming N. Larsen

    Sorry for the late reply. I have been on a scout camp without Internet connection.

    When building Robocode, you need to build it with JDK 6, i.e. Java Developer Kit 6.0 (like described in the Robocode Developers Guide for Building Robocode).

    If you only need to build a version for yourself, you could simply build Robocode and ignore all tests by changing this line:

    mvn clean install ant:ant -DskipTests=false %*
    

    with this line:

    mvn clean install ant:ant -DskipTests=true %*
    
     
  • NPS

    NPS - 2015-07-14

    Thanks for the reply, Flemming!

    I've tested many times after changing to the mvn clean install ant:ant -DskipTests=true %* in mvnassembly.sh file and I've got the same problem.

    I build it using JDK 6. I checked that by calling javac -version command and "javac 1.6.0_45" was returned.

    Tests run: 52, Failures: 10, Errors: 0, Skipped: 3
    [INFO] ------------------------------------------------------------------------
    [ERROR] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] There are test failures.
    Please refer to /home/xxx/robocode-master/robocode.tests/target/surefire-reports for the individual test results.
    [INFO] ------------------------------------------------------------------------
    [INFO] For more information, run Maven with the -e switch
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 4 minutes
    [INFO] Finished at: xxx
    [INFO] Final Memory: 67M/650M
    [INFO] ------------------------------------------------------------------------

    I forgot some step? I really need to fix that... :(

     

    Last edit: NPS 2015-07-14
  • Flemming N. Larsen

    You write that you changed mvnassembly.sh.

    Perhaps you just need to change mvnassembly.bat, as you are running on Windows 8?

    When disabling tests (skipTests=true), Maven should not perform any test. I can see in your last log that the tests are still being run. So make sure the change 'mvn clean install ant:ant -DskipTests=true %*' is made in mvnassembly.cmd. :-)

     
  • NPS

    NPS - 2015-07-14

    Thanks for the reply, Flemming!

    Yes, I changed the wrong file. I modified mvnassembly.bat and now it's works! No more failures during building Robocode!

    Now I really would like to know why those tests have failed...

    One more question: why are those tests important?

     

    Last edit: NPS 2015-07-14
  • Flemming N. Larsen

    I don't know why the tests fails on your side. You'll need to check the reports that is put into your directory /home/xxx/robocode-master/robocode.tests/target/surefire-reports in order to view the details of the errors/failures.

    I use the tests whenever I make a change to Robocode in order to check if something have changed breaking something in the game. Its a kind of "sanity check" before I release an official version of Robocode.

     

Log in to post a comment.