Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse / conditional breakpoint results in BreakpointException

I want to debug a static inner class, which is actually a Callable. Whenever I try to set a conditional breakpoint in Eclipse I get the breakpoint error:

The type com.sun.source.tree.Tree$Kind cannot be resolved. It is indirectly referenced from required .class files.

What is causing this error? Is it a bug in the class/package that uses com.sun.source.tree.Tree$Kind but does not provide it? How do I find out which class it is? How do I resolve it?


An example expression which should be correct is: return mRtx.getNode().getNodeKey() == 74;

I have changed it to mRtx.getNode().getNodeKey() == 74 but still the same error. Recently I've found the bug and simply used:

 if (mRtx.getNode().getNodeKey() == 74) {
     System.out.println("bla");
 }

and set a "normal" breakpoint on the "sysout" statement just in case someone has the same problem.

like image 308
Johannes Avatar asked Sep 02 '11 16:09

Johannes


1 Answers

I am not sure on how I would reproduce it as your description is not exactly telling much.

The com.sun.source.tree package is included in tools.jar, which is part of JDK but not of JRE, so make sure you run your Eclipse in JDK (JAVA_HOME variable?), maybe try setting projects JRE to a JDK folder.

I also think that the Compiler API was introduced in Java 6, so check if you are not using a lower version.

like image 130
MarianP Avatar answered Oct 04 '22 07:10

MarianP