Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Problem with annotations
Problem with annotations [message #189985] Sun, 19 December 2004 01:13 Go to next message
Dim Dimych is currently offline Dim DimychFriend
Messages: 11
Registered: July 2009
Junior Member
Hi there,
Writing a proof-of-concept for a customer but hit upon the compiler
error "Retention cannot be resolved to a type"
This is a code excerpt:

@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface Mark { }

Any ideas? JDK 1.5.0 and freshly installed Eclipse 3.1M4. Everything is
running on W2K.

Thanks!

Dim Dimych
Re: Problem with annotations (addenum) [message #189994 is a reply to message #189985] Sun, 19 December 2004 01:15 Go to previous messageGo to next message
Dim Dimych is currently offline Dim DimychFriend
Messages: 11
Registered: July 2009
Junior Member
Forgot to tell that both and @Retention and @Target annotations are
producing the error message.


Dim Dimych wrote:
> Hi there,
> Writing a proof-of-concept for a customer but hit upon the compiler
> error "Retention cannot be resolved to a type"
> This is a code excerpt:
>
> @Retention(RetentionPolicy.RUNTIME)
> @Target(ElementType.METHOD)
> public @interface Mark { }
>
> Any ideas? JDK 1.5.0 and freshly installed Eclipse 3.1M4. Everything is
> running on W2K.
>
> Thanks!
>
> Dim Dimych
Re: Problem with annotations [message #190079 is a reply to message #189985] Mon, 20 December 2004 10:26 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: zoopy.hates.spam.biz

On 19-12-2004 2:13, Dim Dimych wrote:
> Hi there,
> Writing a proof-of-concept for a customer but hit upon the compiler
> error "Retention cannot be resolved to a type"
> This is a code excerpt:
>
> @Retention(RetentionPolicy.RUNTIME)
> @Target(ElementType.METHOD)
> public @interface Mark { }
>
> Any ideas? JDK 1.5.0 and freshly installed Eclipse 3.1M4. Everything is
> running on W2K.
>
> Thanks!
>
> Dim Dimych

Did you import java.lang.annotation.*; ?

--
Regards,
Z.
Re: Problem with annotations [message #190273 is a reply to message #190079] Mon, 20 December 2004 21:47 Go to previous messageGo to next message
Dim Dimych is currently offline Dim DimychFriend
Messages: 11
Registered: July 2009
Junior Member
>
> Did you import java.lang.annotation.*; ?
>

Wow! That was really the point. Lot of thanks! Now everything is running
fine :)

Cheers,
Dim Dimych
Re: Problem with annotations [message #1786599 is a reply to message #190273] Tue, 08 May 2018 08:14 Go to previous message
Anjali Bidua is currently offline Anjali BiduaFriend
Messages: 1
Registered: May 2018
Junior Member
import java.lang.annotation.*; helped all errors resolved. Thanks
Previous Topic:Set main class in Maven Project
Next Topic:Change Package Explorer Navigation Shortcut
Goto Forum:
  


Current Time: Sat Apr 20 01:24:14 GMT 2024

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

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

Back to the top