Hi Andreas,
You did not write which version of Robocode your are using + which Java version you run Robocode on.
With the newest version of Robocode released a couple of days ago, version 1.9.3.2, a problem with the build-in ECJ (Eclipse Compiler for Java) was updated due to compilation problems under Java 9 and newer.
If this is the version you are using, the try to reset the compiler settings by Robot -> Source Editor, then Compiler -> Options -> Reset compiler in the Robocode Editor.
You will get a choice between using the JDK compiler or the built-in ECJ. You could try out both of them, to see if you get any luck?
Alernatively, you could use an external IDE like Eclipse or IntelliJ. In this case, you need to add "development paths" to tell Robocode where to locate your robot(s) when running Robocode.
Best regards,
- Flemming