Reputation: 1390
The project I've recently been assigned to is stuck using Eclipse as a build tool. (The only version I can get it to display or report is "Indigo". If there's an actual version number associated with that, it's been well hidden. Probably really obvious once you're already an Eclipse expert.)
We've configured our Workspace settings to be mostly the defaults, with some increases in compiler warning levels here and there.
Now, after importing various projects, developers are finding a ton of Java build errors, because the compliance level is shown as 1.4 instead of anything recent; this leads to amusing errors like "assert cannot be resolved to a type". We've gone through every single menu and sub-menu in the "Java Compiler" settings, and "project specific settings" is disabled for all of them. The workspace is configured to use 1.7, but none of those settings are actually being inherited by the project.
For now, we've enabled project-specific settings, and copied (sigh) all of the workspace settings down to each project. This seems to completely defeat the point of having workspace settings in the first place! Is there some hidden setting in each project that we need to reset beyond disabling the project-specific stuff?
</frustrated>
Upvotes: 0
Views: 5246
Reputation: 2463
In Window->Preferences->Java->Compiler I changed the compliance level to something arbitrary and then changed it back to what I actually wanted. This fixed it for me!
Upvotes: 0
Reputation: 16400
You could try two things:
Go into the Configure Build Path dialog and click on the Libraries tab. Look to see which JRE is being used for the project. Sometimes the JRE is set to what was being used in the previous workspace in which the projects were last worked on. You can delete the "System Library" or JRE entry. If you leave things like that I believe that the JRE and settings will default to the workspace defaults. Worst case is you have to go in and "Add Library" to select the correct JRE.
If that fails, you can poke around in the .settings folder in the project's root directory. This is where all the tools store their settings (aside from the .classpath file). When desperate times call for desperate measures you can delete some files in this directory or even the entire directory. Note that the abbreviate JDT in a file or folder name indicates that the file or folder has something to do with the java tooling. Also note that all files and folders whose names start with "." are by default hidden. You need to go to the Navigator view to see them.
Upvotes: 1