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! :-)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
When the ordinary javac compiler from the JDK cannot be found it is usually
due to a faulty installation of the JDK or due to the JAVA_HOME or PATH
environments that needs to be set up as well for the JDK in order for Robocode
to detect the JDK. Read more about the JAVA_HOME and PATH environments here:
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
I am also getting this problem,
please help
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! :-)
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.
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. ;-)
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.
I got it to work, but I solved it by installing an older version of Robocode
I created a bug report here regarding the ECJ compiler:
https://sourceforge.net/tracker/?func=detail&aid=3435721&group_id=37202&atid=
419486
This bug has now been fixed for version 1.7.3.4.
An Alpha version is available here:
http://robocode.sourceforge.net/files/robocode-1.7.3.4-Alpha-
setup.jar
Please try it out. :-)
When the ordinary javac compiler from the JDK cannot be found it is usually
due to a faulty installation of the JDK or due to the JAVA_HOME or PATH
environments that needs to be set up as well for the JDK in order for Robocode
to detect the JDK. Read more about the JAVA_HOME and PATH environments here:
http://robowiki.net/wiki/Robocode/System_Requirements