【问题标题】:unable to watch expressions in eclipse无法在eclipse中观看表达式
【发布时间】:2019-01-07 23:03:22
【问题描述】:

我有一个从 Git 克隆的 Maven 项目。项目已成功构建并完美运行。但是,当我调试并尝试评估函数/表达式时,它给了我错误提示 --

expression must be compiled in the context of a Java Project's build path. 

我阅读了以前的堆栈溢出答案并执​​行了以下操作(没有结果)--

  1. 我在 .project 文件中添加了 java 特性,然后在源代码查找中添加了 Java 项目。我仍然遇到同样的错误。

  2. 如果我从源查找中删除 Java 项目并在添加源查找路径时选择选项 --“工作区文件夹”,则会出现空指针异常。

谁能告诉我如何解决这个问题?

【问题讨论】:

    标签: java eclipse maven debugging


    【解决方案1】:

    试试这个!!!

    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.
    

    【讨论】:

    • 我已经尝试过了 (stackoverflow.com/questions/11988117/…)。 1. 我需要将我的项目性质更改为 Java 性质。只有这样项目才变得可见 2. 即使我改变了性质,这也无济于事。我得到同样的错误
    • 你试过这个Right click on the project ->build path -> select source tab -> add folder然后添加包含java类的文件夹。
    猜你喜欢
    • 2012-05-27
    • 2017-04-30
    • 1970-01-01
    • 2012-01-20
    • 2015-11-15
    • 2015-04-28
    • 1970-01-01
    • 2014-10-14
    • 1970-01-01
    相关资源
    最近更新 更多