Eclipse Inspect(Ctrl + shift + I)不起作用

PSR*_*PSR 17 eclipse

我在Eclipse中检查了一个maven项目,我无法检查变量(右键单击变量并单击Inspect选项).

当我尝试这样做时,我收到以下消息:

To perform any evaluation, an expression must be compiled in the 
context of a java project's build path. The current execution 
context is not associated with a java project in the work-space.
Run Code Online (Sandbox Code Playgroud)

任何人都可以知道这可能是什么原因吗?

提前致谢.

Ash*_*dal 11

可能很有用:

Find the thread in your debug window that you are in the breakpoint for. Right click on it. Under relaunch should be an edit launch configuration selection. Select that.

Select Source tab. Add. Java Project. Select the java project that the code exists in.
Run Code Online (Sandbox Code Playgroud)


PSR*_*PSR 4

我通过执行以下操作解决了这个问题:

右键单击project ->build path -> select source tab -> add folder,然后我添加了包含 java 类的文件夹。