Menu

Building Robocode

Help
James
2014-11-14
2014-11-14
  • James

    James - 2014-11-14

    OS: Arch Linux 64 bit
    Java Version: java-jdk-8

    Procedure:
    1) Install Egit into Eclipse, create a workspace (/home/steelcowboy/robogit)
    2) Import master branch from Git, using default directory (/home/steelcowboy/git/robocode) and unchecking plugings
    3) Run mvnassembly, producing errors such as:

    [INFO] An error has occurred in JavaDocs report generation:
    Exit code: 1 - /home/steelcowboy/git/robocode/robocode.api/src/main/java/robocode/_AdvancedRobot.java:36: error: bad use of '>'
    * If {@code degrees} > 0 the robot's gun is set to turn left.
    ^

    And it mentioning a few times things like

    [INFO] skip non existing resourceDirectory /home/steelcowboy/git/robocode/robocode.api/src/test/resources
    [INFO] [compiler:testCompile {execution: default-testCompile}]
    [INFO] No sources to compile

    4) Try mvn clean install, produce errors such as:

    [INFO] Scanning for projects...
    [ERROR] The build could not read 13 projects -> [Help 1]
    [ERROR]
    [ERROR] The project net.sf.robocode:robocode.core:${robocode.version} (/home/steelcowboy/git/robocode/robocode.core/pom.xml) has 1 error
    [ERROR] 'dependencies.dependency.version' for net.sf.robocode:robocode.api:jar must be a valid version but is '${robocode.version}'. @ net.sf.robocode:robocode.core:[unknown-version], /home/steelcowboy/git/robocode/robocode.core/pom.xml, line 16, column 13

    5) In Eclipse, as per the wiki, do HEAD revisions, Clean all -- all successfully, even in console reports "build successful". Also, ensure M2_REPO set correctly.

    6) Hit run, get the following error:

    Variable references non-existent resource : ${workspace_loc:robocode.api/target/launch}

    7) Check error, even though I ran mvnassembly says a lot of maven errors:

    Project 'robocode.core' is missing required library: /home/steelcowboy/.m2/repository/junit/junit/4.11/junit-4.11.jar

    87 of those

    Can anyone help me figure out what I did wrong to get all of these errors? It seems like mainly a maven problem but I don't know how to get fix all of these maven errors since mvnassembly does nothing new except try to compile again and spit out errors...

    Thanks!

     
  • Flemming N. Larsen

    You must use a an old Java JDK 6 in order to build Robocode - and use the Oracle JDK 6, if you want to make sure that Robocode will be able to build everything correct with 'mvnassembly.sh'.

    The JDK 6 is used to ensure that Robocode WILL run on systems using Java 6 or newer. If Robocode was compiled with Java 7 or 8, there would be no 100% guarantee that Robocode will actually run with Java 6. Hence, Robocode currently needs to be build with JDK 6.

    Note that you might only need to set the JAVA_HOME to point at your JDK 6, and parhaps also add the $JDK_HOME/bin to your PATH. You could create a script, that sets these values for you or just write these into the mvnassembly.sh.

     

Log in to post a comment.