|Project not using workspace Java compliance setting [message #1792029]
||Tue, 10 July 2018 09:13
In order to get the default workspace settings for Java compliance level I need to enable project specific settings on my project and then go with the same default settings as are used for the workspace. Otherwise it seems to be using 1.4 compliance level in terms of displaying compiler errors in my Java editors (see description of these errors below). Can anyone suggest what I might be doing wrong? I am using the latest Helios release.|
Thanks in advance for your help.
(below is a description of the original problem which led me to discover my compliance level setting issue described above)
I am seeing many error indicators (small red X icon to the left on the code line in question) when I open Java files in an editor, however the code builds fine and corresponding error indicators are not showing up next to the file name in the Package Explorer nor are they listed in the Problems View.
Most of these errors are related to generics, with the most common error message being "The type X is not generic; it cannot be parameterized by <y, Z>".
In the Eclipse preferences Java->Compiler->Errors/Warnings I have the three Generic types options set to Ignore and Warning. The workspace Java compiler compliance level is set to 1.6 and I am using a 1.6 JRE from the latest JDK downloaded from Sun.
An example is this: I have an abstract entity/POJO class which looks like this:
public abstract class AbstractBaseEntity<T>
private T id;
The above code displays no errors in the Eclipse Java editor. However when I open other classes which extend the above class I see an error indicator on the line where I extend the class, and when I hover over the error icon I see this error message: "The type AbstractBaseEntity is not generic; it cannot be parameterized with arguments <Long>." However the code builds fine and there are no other error indicators anywhere in the project -- it seems that only the editor is using a different Java compliance level but everything else is dealing with the generics just fine.
Powered by FUDForum
. Page generated in 0.01451 seconds