• Post Reply Bookmark Topic Watch Topic
  • New Topic

annotations and packages  RSS feed

 
jeroen dijkmeijer
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi I'm about to start with java ee 5 and all the related subjects but before that I thought it'd be handy to lay my hands on annotations. Normally I start with these kind of new technologies with nothing more than the commandline, an d texteditor (together called emacs). And Sun's annotations example
That worked fine, but then I decided to have the classes in a different package than the the Annotated class (Test in empty package) and the rest in nl.ing.test., and there it blows:


Has anybod tried this before, or can point me te some more thorough tutorials?
Thanks in advance,
Jeroen.
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16060
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The compiler cannot find the Test annotation. you should have an annotation class that looks like this:

Try searching Google for java annotations tutorial.
[ October 10, 2006: Message edited by: Jesper Young ]
 
jeroen dijkmeijer
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your answer, but..
My question was how can I have the annotation class in another package, I tried the no/empty/"" package, still havent got that working. However, putting it inside a different package like

makes it work with import statements or even (which, for me as a annotation novice and on a steep learning curve, would have been more readable) stating that annotions are just some special classes, and addressable by normal package naming convention.

again thankx for your answer,
Jeroen.
[ October 10, 2006: Message edited by: jeroen dijkmeijer ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!