0

I am newbie at Java EE and I have a simple problem. I created a project using Maven plugin's default directory structure and I want to annotate a class as @Loggable, but I get a

Loggable cannot be resolved to a type

error. Any annotation I want to use can't be resolved to a type. What's the problem? I suspect that it has to do with dependency or build path issues but I can seem to get it working.

1
  • Did the loggable annotation class library in the classpath ? If it's not there then you may face this. Commented Jan 15, 2014 at 10:16

2 Answers 2

1

You will have a list of dependencies in the pom.xml file of your maven project. Make sure the jar that has Loggable is listed as a dependency.

Read here how to do it.

Your import java.lang.annotation.*; will not help as Loggable is not in that namespace.

Maybe you should write this Annotation on your own. Read this to learn more.

Sign up to request clarification or add additional context in comments.

1 Comment

I had to write the annotation on my own. Thanks !
0

You have to import annotation classes just like anything else. Use an IDE such as Eclipse; it will handle and many similar tasks for you automatically.

3 Comments

I do, and I already have imported import java.lang.annotation.*; but still no resolve.
There is no Loggable annotation in java.lang.annotation.
@GeorgeD There are dozens of Loggables out there. Which framework are you trying to use.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.