In my code, I am trying to output the value of src
in the expressions window.
public void doIt() {
String src = \"test\";
System.out.pri
If your code use any generics, you may want to check this bug:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=341232
Occurs in all version of Eclipse up to 4.2. In short certain generics expressions cause Eclipse to completely fail on any evaluation (please see this example: https://bugs.eclipse.org/bugs/attachment.cgi?id=224760). Not sure whether your code uses any generics, but if so, this may be it. Note that it is enough to have one of the troublesome generics somewhere in your class, not necessary in your method.
According to https://stackoverflow.com/a/21763943/733092, this happens when the class contains a generic method like
public <T extends something> T myMethod() {};
Check if you have updated version of Eclipse, looks like this issue is fixed in Eclipse 3.3
My Eclipse Version is 3.8.2 and if I evaluate the expression on line 2 then I am also receiving the same error but at line 3 its evaluating properly.
I had the same problem and I remove a generic method in my code. It work for me.
I just spent TONS of time to figure out that if you will create a package "Foo" and inside this package you'll create class called "Foo", like this:
package Foo;
public class Foo{
public Foo () {};
}
After the point when you use this class first time in your program, you will not be able to use expressions anymore:
import Foo.Foo; //this is the devil i think
public static void main(String[] args){
EventQueue.invokeLater(new Runnable(){
public void run(){
//debug expressions works fine
Foo tmp = new Foo();
//debug expressions wouldn't work anymore
}
});
}
This bug can be reprodused up to current Eclipse Neon 4.7.
(Assuming you're compiling 1.5+ code)I had the same problem, here's what I did to fix it: