Hello,
This error has been really annoying since it completely blocks the compiler. Basically, when I create a default class file, I'm just about fine, and I can code as much as I want in it. But as soon as I try to delete the default comments that are in the file, because I don't like having them there, the compiler starts underlining an error on the very last line of the class file, saying "Illegal character: '\u0000'".
Now, I don't know if there's an easy fix for this, but as I can see from my research, the \u0000 character is the "NUL" character in ASCII, so the fact that the compiler would stumble upon that is pretty weird.
I've tried Ctrl+A and delete all, but that doesn't get rid of it.
Thank you for any help!
Arak
EDIT 1: I've discovered that it also does it if I delete some random lines in the file (while respecting syntax of course).
EDIT 2: Here is the code for my PlanetWorld class. The comment at the end gets rid of the error, but also creates the exception "java.lang.ClassFormatError: Extra bytes at the end of class file PlanetWorld".
EDIT 3: After doing more research on the subject, and seeing that this could be caused by the compiler reading the file "wrong" because of FTP, I want to add that this happens on my school's computers, which work based on a local server.
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) /** * Write a description of class PlanetWorld here. * * @author (your name) * @version (a version number or a date) */ public class PlanetWorld extends World { /** * Constructor for objects of class PlanetWorld. * */ public PlanetWorld() { super(600, 600, 1); //Color //the color is supposed to be set to random for the background. Color themeColor = new Color(Greenfoot.getRandomNumber(255), Greenfoot.getRandomNumber(255), Greenfoot.getRandomNumber(255)); GreenfootImage background = getBackground(); background.setColor(themeColor); setBackground(background); } } //The only way I found to stop that "illegal character: '\u0000'" error is to put a comment here.