无法在 Intellij IDEA 中设置 Java 断点 [英] Cannot set Java breakpoint in Intellij IDEA

查看:50
本文介绍了无法在 Intellij IDEA 中设置 Java 断点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在 GoogleAppEngine 源代码 (SDK 1.7.0) 中设置断点,但 IDEA Ultimate (11.0.2) 一直告诉我 警告:在 com.google 类的第 482 行找不到可执行代码.appengine.api.memcache.AsyncMemcacheServiceImpl.

I'm trying to put breakpoints into the GoogleAppEngine sources (SDK 1.7.0) but IDEA Ultimate (11.0.2) just keeps telling me Warning: No executable code found at line 482 in class com.google.appengine.api.memcache.AsyncMemcacheServiceImpl.

当我运行单元测试中的代码和启动开发服务器时,我都会收到此错误消息.

I get this error message both when I run the code from unit tests and I start up the development server.

这很烦人.无论如何,我的源代码位于外部(相对于 IDEA 主目录和项目主目录)目录中,而我的 jar 文件位于 Appengine SDK lib 目录下.

It's quite annonying. Anyway my sources are in an external (relative to both the IDEA home and the project home) directory, and my jar files are under the Appengine SDK lib dir.

我的 jar 文件作为项目库添加​​到模块中,我的源代码附加到这个库中.我也在玩模块依赖关系,但没有任何运气.最后我决定把这个库放到 Compile 范围内,但这是个坏主意,因为 SDK 在运行时提供这些 jar,所以我决定回退到提供范围.

My jar files are added as project library to the module, and my sources are attached to this library. I was playing around with module dependencies as well, but without any luck. Finally I decided to put this library into Compile scope, but that was a bad idea since the SDK provides these jars at runtime, so I decided to fall back to Provided scope.

我还使用了模块依赖项选项卡上的导出复选框,但我认为这无关紧要,根据 网络帮助,只有当您有相关模块并且您希望在这些模块中也可以使用您的库时,导出才很重要.

I also played with the export checkbox on the module dependencies tab, but I think this is irrelevant, according to the web help, export is only important when you have dependent modules and you want to make your library available in these modules as well.

无论如何,这个问题也在 4 年前出现了.所以我现在想知道这个问题真的那么难解决吗?

Anyway, this question arised 4 years ago also. So I'm wondering now whether is it really so hard to solve this issue?

我现在很失望.到目前为止,我对 IDEA 没有任何问题......我看到了这个问题 其他人也有,所以我猜这不是唯一的.

I'm very disappointed now. I didn't have any problems with IDEA so far... I saw that this problem arised to other people as well, so this is not unique I guess.

感谢任何帮助.

由于下面的 javap 实验,我编辑了我的问题:似乎类和源不同步.我查看了 SVN 的 1.7.0 相关修订版,我使用的是 1.7.0 SDK,所以这些应该不会不同步.

I edited my question due to my javap experiments below: It seems that the classes and the sources are NOT out of sync. I checked out the 1.7.0 related revision from SVN, and I'm using the 1.7.0 SDK, so these should not be out of sync at all.

推荐答案

我也遇到过类似的问题,并进行了各种尝试.以下是我通常的步骤:

I had similar problems and various attempts has been applied. Below is my usual steps:

  1. 如果您正在使用 Maven 依赖项,请转到 Maven 项目 -> 刷新
  2. 如果这不起作用,请尝试顶部菜单 --> 构建 --> 重建项目
  3. 如果仍然不起作用,请尝试顶部菜单 --> 文件 --> 使缓存/重启无效
  4. 如果还是不行,那么 $CATALINA_BASE/bin/catalina.sh 停止,然后启动

在此之后,通常它涵盖了 99% 的问题.否则,可能您将不得不检查其他一些可能性.

After this, usually it covers 99% of the problems. Otherwise, Probably you will have to examine some other possibilities.

这篇关于无法在 Intellij IDEA 中设置 Java 断点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆