Menu

Cannot find Compiler

Help
himase
2011-11-08
2012-09-15
  • himase

    himase - 2011-11-08

    I get this error message, no matter what I do.

    Please wait while Robocode sets up a compiler for you...

    Setting up compiler

    Java home is C:\Program Files (x86)\Java\jre7

    Testing compile with Java Compiler (javac)

    Java Compiler (javac) does not exists or cannot compile.

    Testing compile with Eclipse Compiler for Java (ECJ)

    java.lang.NullPointerException

    at sun.launcher.LauncherHelper.getMainClassFromJar(Unknown Source)

    at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)

    Exception in thread "main"

    Eclipse Compiler for Java (ECJ) does not exists or cannot compile.

    Unable to set up a working compiler for Robocode.

    Im not very experienced with java, so please help

     
  • james smith

    james smith - 2011-11-09

    I am also getting this problem,

    please help

     
  • Flemming N. Larsen

    First of all. If you want to use the normal Sun/Oracle Java compiler, you must
    install the JDK (Java Developer Kit), as the JRE (Java
    Runtime Environment) does not contain the compiler and other Java development
    tools.

    However, I realised that upgrading ECJ from 3.5.2 to 3.7 did not go well, as
    Robocode can find the new compiler anymore, which is a bug. So I will need to
    fix that soon! :-)

     
  • james smith

    james smith - 2011-11-10

    thank you very much for your reply. I have already installed JDK, but I am
    still getting the same error.

    Please do your best to fix the bug as quickly as you can, for I am very eager
    to get started.

     
  • Flemming N. Larsen

    If you have the JDK installed, you don't have to wait for the next version of
    Robocode, even though I am working on the current problem.

    In Robocode, select this from the menu:

    Robot -> Editor -> Compiler -> Options -> Preferences

    Fill in these values in the various fields:

    Compiler Binary
    javac

    Compiler Options
    -deprecation -g -source 1.5 -encoding UTF-8

    Compiler Classpath
    -classpath "C:\Program Files\Java\jre7/lib/rt.jar";libs\robocode.jar;C:\robocode\robots

    For the classpath you will need to check where your rt.jar is located, and
    also where Robocode is installed etc.

    I guess you'll be able to figure this out. ;-)

     
  • AlexTsCZ

    AlexTsCZ - 2011-11-11

    I am having a similar problem. I have JDK and JRE but cannot get it to run. I
    did what you said and added those commands.

     
  • james smith

    james smith - 2011-11-11

    I got it to work, but I solved it by installing an older version of Robocode

     

Log in to post a comment.

MongoDB Logo MongoDB