You put
public boolean running = false;
outside of a class definition, effectively in the global namespace. But there are no globals in Java. This is not legal.
I'll say, that's a strange error message for that though. I would expect a little more from the compiler. Something to the effect of class
or interface
or enum
because once you start the statement with public
there are exactly three legal things that can follow. But, it is what it is. So, the compiler is right to complain, I just would have expected a more informative error message.