在eclipse控制台中,我可以单击堆栈跟踪,它应该带我到java而不是.class文件? [英] In eclipse console can I click on Stack trace and it should take me to java instead of .class file?

查看:410
本文介绍了在eclipse控制台中,我可以单击堆栈跟踪,它应该带我到java而不是.class文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的配置如下

Java Project1: IADTPrj
J2ee Project2: TestJ2EE references IADTPrj

Classpath条目< classpathentry kind =libpath =/ IDCT / bin/ >

Classpath entry <classpathentry kind="lib" path="/IDCT/bin"/>

我在logger中得到了一些输出(SomeClass.java30)其中我想点击并去其java文件行号。但是eclipse把我带到它的.class文件。更糟糕的是,我有一个java反编译器安装,它带我到一个 看起来相似的java代码 SomeClass.class ,但再次错误的行(

I have in logger get some outputs like (SomeClass.java:30) which I want to click to and go to its java file line no. 30. But eclipse is taking me to its .class file. To make matters worse i have a java decompiler installed which takes me to a look alike java code of SomeClass.class but again to the wrong line number.(line numbers are not preserved after decompiling. But it says which original java line number corresponds to current decompiled class!)

现在可以定义搜索路径用于查找超链接,以便我可以指定在相关项目中首先搜索java文件,然后搜索类文件。所以我可以直接编辑SomeClass.java并重新部署。

Now is this possible to define the search path for finding the hyperlinks, so that I can specify to search for java files first in the related project and then class files. So that I can edit SomeClass.java directly and re-deploy.

推荐答案

这是因为你没有附加任何源或文件夹)到该类。

This is because you did not attach any source (jar or folder) to that class.

有很多方法可以将源jar或文件夹附加到jar中;一个简单的方法是在软件包资源管理器中右键单击jar并选择属性。

There are many ways to attach a source jar or folder to a jar; an easy one is to right click on the jar in the package explorer and select properties.

如果你有jadclipse,那么如果配置正确,真正的源代码应该优先反编译代码。但请注意,如果您更改配置并测试同一类,您将认为您的配置不会被考虑,因为反编译的源仍然会显示。我不知道任何其他修复,比重新启动eclipse(或测试另一个类)。

If you have jadclipse, then if configured correctly, the real source code should take precedence over the decompiled code. Please be aware however, that if you change the configuration and test the same class, you will think that your configuration will not be taken into account because the decompiled source will still show up. I don't know of any other fix than restart eclipse (or test another class).

这篇关于在eclipse控制台中,我可以单击堆栈跟踪,它应该带我到java而不是.class文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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