I actually found a solution for this which I wanted to share but wasn’t sure how to do it, so I’m doing it in the form of a question and hopefully this helps someone!
The initial situation is that when I cloned my coursework from Github to eclipse all files looked like this:
public class SchedulerSimulator {     public static void main(String[] args) {         if(args.length > 2) {             // ...             // Instantiates a Scheduler object.             // ...             // Calls "schedule" on the Scheduler object.                     // ...             // Calls "outputSchedule" on the Scheduler object.             // ...         }     }   }
I was super confused, and googled it and realised I had to switch my encoding to UTF-8, HOWEVER, this only led to every line of my code being red and filled with annotation errors which didn’t make sense to me. What I found out was that the SPACE everywhere on the file wasn’t an actual space, but something along the lines of “narrow no-break space”. I’m guessing this was suggested by the “ ” but at first I didn’t realise it.
This space is what caused red lines everywhere and I’m attaching some pictures for reference below.
Hopefully this helps, all you have to do is replace all the narrow space with normal space and it solves it:).