I cannot get Robocode to create a compiler. I am running Windows 10 x64 bit and JDK 13, as well as the latest version of Robocode.
JDK 13 has the PATH on my computer and is the SDK for my project. I keep getting this error:
Please wait while Robocode sets up a compiler for you...
Setting up compiler
Java home is C:\Program Files\Java\jdk-13.0.2
Testing compile with Java Compiler (javac)
error: file not found: compilers\CompilerTest.java
Usage: javac <options>
use --help for a list of possible options
Java Compiler (javac) does not exists or cannot compile.
Testing compile with Eclipse Compiler for Java (ECJ)
Error: Could not find or load main class org.eclipse.jdt.internal.compiler.batch.Main
Caused by: java.lang.ClassNotFoundException: org.eclipse.jdt.internal.compiler.batch.Main
Eclipse Compiler for Java (ECJ) does not exists or cannot compile.</options>
Unable to set up a working compiler for Robocode.
I am unsure what to do. I have tried the solutions that I have seen posted here, but again I have not seen anything too recent. Any pointers would be appreciated. Thank you.
Anonymous
You could check your compiler options.
If you are using 'javac' from the JDK, the compiler preferences (Compiler -> Options -> Preferences) you should have the following settings:
Binary Compiler:
javac
Compiler Options:
-verbose -encoding UTF-8
Compiler Classpath:
-classpath libs\robocode.jar;C:\robocode\robots
If you are using ECJ, the compiler preferences should look like this:
Binary Compiler:
java -cp compilers/ecj.jar org.eclipse.jdt.internal.compiler.batch.Main
Compiler Options:
-verbose -encoding UTF-8
Compiler Classpath:
-classpath libs\robocode.jar;C:\robocode\robots
Notice: When using the 'javac' compiler, you needthe JDK/bin folder to be on the PATH.
You should be able to call this from a command prompt:
Hello!
Thank you for the reply. Unfortunately I still get errors even when I do that:
I am running javac 13.0.2 (the latest version) with Java 1.8.0_241 (the latest version). I suspected a version issue, but being a bit of a novice I am not too entirely certain. Javac does have the path on my computer.
I am not sure what causes the issue on your system. I just tried out the newest version with JDK 13.0.2, where it works fine.
Hmm... have you tried to create a clean/fresh installation folder of Robocode, e.g. under C:\Robocode (just for the test).
Make sure to install Robocode using this command:
Run robocde using the robocode.bat file from the installation folder.
I cannot seem to get that to work for me, either. I keep getting the same errors...
I could be a problem with JDK 13 - even though I can't reproduce the issue.
Hmm... You could try installing and older JDK, e.g. JDK 11 or 10 and see if that changes anything for you. If so, we need to have a look at the JDK to see if it causes some new issues not seen before.
I tested using OpenJDK 13 btw. Perhaps you are using the Oracle JDK 13?