Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Cannot suppress warnings(Cannot suppress warnings using @SuppressWarnings)
Cannot suppress warnings [message #507892] Thu, 14 January 2010 21:10 Go to next message
Eclipse UserFriend
Eclipse Platform Version: 3.4.2

I've tried changing the compiler compliance level to 1.5 and 1.6. In either case when I try to suppress warnings for methods that are not invoked using @SuppressWarnings("unused") I get the error, "SuppressWarnings cannot be resolved to a type"

What do I need to do to make eclipse use this annotation?

Re: Cannot suppress warnings [message #507919 is a reply to message #507892] Fri, 15 January 2010 03:02 Go to previous messageGo to next message
Eclipse UserFriend
Will wrote:
> Eclipse Platform Version: 3.4.2
>
> I've tried changing the compiler compliance level to 1.5 and 1.6. In
> either case when I try to suppress warnings for methods that are not
> invoked using @SuppressWarnings("unused") I get the error,
> "SuppressWarnings cannot be resolved to a type"
>
> What do I need to do to make eclipse use this annotation?
First, make sure that the project really has the right compliance: it
might have project specific compliance set which differs from the
workspace settings. Second, verify that the JRE library on the project's
Java build path is 1.5 or higher.

Dani
Re: Cannot suppress warnings [message #508037 is a reply to message #507919] Fri, 15 January 2010 10:53 Go to previous messageGo to next message
Eclipse UserFriend
Thanks Dani,

I should note that I'm using eclipse with the BlackBerry JDE plugin, however this error arises even before I try to compile. Nonetheless could this be at the root of the problem?

I have verified that the project compliance is 1.5.
Project->Properties->Java Compiler

I have verified that the workspace compliance is 1.5.
Window->Preferences->Java->Compiler

I have verified that the installed JRE is 1.6 (jre6)
Window->Preferences->Java->Installed JREs

I still have the problem. Could the problem be related to annotation settings?
Re: Cannot suppress warnings [message #508044 is a reply to message #508037] Fri, 15 January 2010 11:29 Go to previous messageGo to next message
Eclipse UserFriend
Will ha scritto:
> I have verified that the installed JRE is 1.6 (jre6)
> Window->Preferences->Java->Installed JREs

You have to make sure that the JRE 1.6 is the one that is in your
project build path:
Project->Preferences->Java Build Path->Library->JRE System Library

Mauro.
Re: Cannot suppress warnings [message #508071 is a reply to message #508044] Fri, 15 January 2010 13:37 Go to previous messageGo to next message
Eclipse UserFriend
Thanks Mauro,

I've gotten past the initial error. Now I get the following warning, "Unnecessary @SuppressWarnings("unused")"

When I compile warnings are still output as if there was no annotation.

I'm using rapc.
Re: Cannot suppress warnings [message #508264 is a reply to message #508071] Mon, 18 January 2010 03:13 Go to previous messageGo to next message
Eclipse UserFriend
Will ha scritto:
> I've gotten past the initial error. Now I get the following warning,
> "Unnecessary @SuppressWarnings("unused")"
>
> When I compile warnings are still output as if there was no annotation.

Hmmm... the "Unnecessary @SuppressWarnings("unused")" error means that
you wrote a @SuppressWarnings("unused") that is useless (that is: there
are no unused variables in your class).
If you want to hide ALL the warnings, you have to use
@SuppressWarnings("all").

Hope this helps.
Re: Cannot suppress warnings [message #537050 is a reply to message #507892] Tue, 01 June 2010 03:50 Go to previous message
Eclipse UserFriend
BlackBerry JDE doesn't support annotations, so @SuppressWarnings will not work.
Previous Topic:JAR file dilemma
Next Topic:Copying Binding Info to new ASTNode ?
Goto Forum:
  


Current Time: Mon Nov 10 09:04:23 EST 2025

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

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

Back to the top