Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Project not using workspace Java compliance setting
Project not using workspace Java compliance setting [message #1792029] Tue, 10 July 2018 09:13 Go to next message
Eclipse UserFriend
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.

--James

========================================
(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:

@MappedSuperclass
public abstract class AbstractBaseEntity<T>
implements Serializable
{
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.
Re: Project not using workspace Java compliance setting [message #1792127 is a reply to message #1792029] Thu, 12 July 2018 04:55 Go to previous messageGo to next message
Sarika Sinha is currently offline Sarika SinhaFriend
Messages: 131
Registered: February 2010
Location: Bangalore, India
Senior Member
The latest Eclipse Photon 4.8 does not show this error, can you try it out?
Eclipse Helios is 8 years old and there is no support available for that.


Sarika Sinha
JDT Programmer
Re: Project not using workspace Java compliance setting [message #1863677 is a reply to message #1792029] Tue, 20 February 2024 23:33 Go to previous messageGo to next message
Luke Johnson is currently offline Luke JohnsonFriend
Messages: 2
Registered: February 2024
Junior Member
I'm using Version: 2023-12 (4.30.0)
Build id: 20231201-2043
and I'm getting this problem.
I'm using Amazon Corretto 17.0.9.8.1 btw.

I've included a screenshot showing the syntax error that appears unless I switch to "Use project specific settings."
Re: Project not using workspace Java compliance setting [message #1863784 is a reply to message #1863677] Mon, 26 February 2024 21:31 Go to previous message
Luke Johnson is currently offline Luke JohnsonFriend
Messages: 2
Registered: February 2024
Junior Member
Never mind, I fixed it by changing the compiler compliance level to an earlier version, then changed it back to JDK 17, and it works now.

I don't need project specific settings.
Previous Topic:Reset Java Version - Switch from 1.8 to 21
Next Topic:Exploring CRUD Operations with Mongoose and MongoDB in JDT
Goto Forum:
  


Current Time: Thu Apr 25 19:29:49 GMT 2024

Powered by FUDForum. Page generated in 0.03355 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top