Eclipse Inspect(Ctrl+shift+I) 不起作用
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11988117/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Eclipse Inspect(Ctrl+shift+I) not working
提问by PSR
I checked out a maven project in Eclipse and am unable to Inspect a Variable (right click on the variable and click Inspect option).
我在 Eclipse 中检查了一个 Maven 项目,但无法检查变量(右键单击变量并单击检查选项)。
When I attempt to do so, I get the following message :
当我尝试这样做时,我收到以下消息:
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.
Can any one know what the reason for this might be?
任何人都可以知道这可能是什么原因吗?
Thanks in advance.
提前致谢。
采纳答案by PSR
I solved this problem by did the following:
我通过执行以下操作解决了这个问题:
Right click on the project ->build path -> select source tab -> add folder
and then i added
the folder which contains the java classes.
右键单击project ->build path -> select source tab -> add folder
,然后我添加了包含 java 类的文件夹。
回答by Ashutosh Jindal
Thismight be useful:
这可能有用:
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.
在调试窗口中找到您所在断点的线程。右键单击它。在重新启动下应该是编辑启动配置选择。选择那个。
选择源选项卡。添加。爪哇项目。选择代码所在的java项目。
回答by Marc
Also, in your launch configuration, be sure that the source path is correctly specified.
此外,在您的启动配置中,请确保正确指定了源路径。
That is to say: Run/Debug Configurations / Source tab / Add... / Java Project
也就是说:运行/调试配置/源选项卡/添加.../Java项目
Make sure the project containing your source code is in that list!
确保包含您的源代码的项目在该列表中!
回答by Manimaran
I got the same error message.
我收到了同样的错误信息。
To solve that
"Debug Configuration" >> {{JAVA_DEBUG_APPLICATION_NAME}} >> Source (tab)
为了解决那个
"Debug Configuration" >> {{JAVA_DEBUG_APPLICATION_NAME}} >> Source (tab)
Check the source is added correctly,
检查源是否正确添加,
For me,
为了我,
- while debugging the java code it opens the class file, which should not be edited.
- got the error message too,
- 在调试 Java 代码时,它会打开不应编辑的类文件。
- 也收到了错误信息,
I have removed the sources from the source tab, It solved both the problem
我已经从源选项卡中删除了源,它解决了两个问题