I created a project “Sample Code”… here I just paste sample code… much of it is snippets that won’t compile.
Is there some project-specific setting I can make so that Eclipse doesn’t try to compile it?
I would prefer not to have the source code littered with red error markers.
MY SOLUTION
ok, this is not an exact solution to my problem… but it is another way to do it and I kinda like it now…
I simply forget about using Eclipse to store the sample java files!
I found a good program CodeBox for Mac to store code snippets and I’m sure there exist such things for Windows, Linux too…
there interesting thing is that when I choose from this program to open the java snippet file (.java) in an external editor (Eclipse), it will open in Eclipse without any Syntax checking… wohoo! no squiggly lines
Because of this, it is not full blown code highlighting… classes and variables same color… but that’s ok.. still quite readable. Much more than if it was in Eclipse with syntax highlighting running on it…
So basically, if you want to get rid of these red squiggles… one way to do it is don’t keep sample .java (or other language) files in a project in Eclipse… simply keep them in the filesystem or code storage app and open them with Eclipse when you want to view them.