Menu

#400 Problem to compile Robot

1.9.3.3
closed
compiler (1)
1
2018-09-10
2018-06-08
LUIZ SANTOS
No

Hi.
I am trying to compile the robots and I get the message:

Compiling...
Unable to load annotation processing manager org.eclipse.jdt.internal.compiler.apt.dispatch.BatchAnnotationProcessorManager from classpath.

Compile Failed (-1)

---- Codesize ----
Codesize: 4369 bytes
Robot weight class: MegaBot (codesize >= 1500 bytes)

How can I to fix it?

Thanks.

Discussion

  • Flemming N. Larsen

    You do not write which OS you are running Robocode on, or if you are using a JRE/JDK from Oracle + which Java version.

    With Robocode you have several options for compiling a robot:
    1) Compile robots using the JDK (found here)
    2) Compile robots using the built-in ECJ (Eclipse Compiler for Java)
    3) Build robots using an external IDE like e.g. Eclipse, IntelliJ or Netbeans

    If you are running Robocode "stand-alone" outside an IDE, you could try to reset the compiler by clicking Compiler -> Options -> Reset Compiler from the Robocode Editor. If you have the JDK installed correctly, Robocode should be able to locate the 'javac' compiler automatically. You can choose to use the Eclipse Compiler for Java instead as well.

     
  • Anonymous

    Anonymous - 2018-07-28

    HI,

    Clean install of java and Robocode today.
    jre1.8.0_181.
    Windows 10.
    Built in compiler.

    Same error :(

    Running from a command line :
    java -cp compilers/ecj.jar org.eclipse.jdt.internal.compiler.batch.Main -deprecation -g -source 1.6 -encoding UTF-8 -classpath "C:\Program Files\Java\jre1.8.0_181/lib/rt.jar";libs\robocode.jar;C:\robocode\robots C:\robocode\robots\njb\Rastas.java

    gives:
    Error: Could not find or load main class org.eclipse.jdt.internal.compiler.batch.Main

    Not sure what basic 1st step ive missed

     
  • Anonymous

    Anonymous - 2018-07-28

    Update after looking at someone elses problem i tried removing "-source 1.6" from the compile options. I dont know what that does, but it now compiles.

     
  • Flemming N. Larsen

    Thanks for the tips for "-source 1.6". It simply means that the compiled code is for Java 6 (1.6). But with newer versions of java, it can be left out.

    Hence, I will remove it with the next release of Robocode. :-)

     
  • Flemming N. Larsen

    Ticket moved from /p/robocode/support-requests/27/

     
  • Flemming N. Larsen

    • labels: --> compiler
    • assigned_to: Flemming N. Larsen
    • Group: none --> 1.9.3.3
     
  • Flemming N. Larsen

    • status: open --> closed
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.