如何导航到.java文件,而不是类路径中指定的源路径的.class文件? [英] How can I navigate to a .java file instead of a .class file with sourcepath specified in the classpath?

查看:267
本文介绍了如何导航到.java文件,而不是类路径中指定的源路径的.class文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个预建的jar在我的项目的libs文件夹下加快构建时间。然而,我想浏览lib的源码,当导航到其中一个包含的类,所以添加以下行到.classpath:

 < classpathentry kind =libpath =libs / mylib.jarsourcepath =/ MyLibSrc/> 

其中MyLibSrc包含mylib.jar的源代码。当我浏览到一个lib的类时,Eclipse会打开相应的.class文件,而不是.java文件。我如何设置在MyLibSrc下打开.java文件?有时候我可以在导航到它时真的想编辑.java文件。

解决方案



只需右键单击您的项目,转到属性和在java构建路径的源代码选项卡下添加您的Jar的Java文件..应该这样工作..尝试这两个选项..忘了哪一个曾经工作..做了很久以前..所有最好的


I have a prebuilt jar under my project's libs folder to speed up build-time. However, I would like to browse the lib's source when navigating into one of its contained classes, so thus added the following line to .classpath:

<classpathentry kind="lib" path="libs/mylib.jar" sourcepath="/MyLibSrc"/>

Where MyLibSrc contains the source for mylib.jar. When I navigate into one of the lib's classes, Eclipse opens the corresponding .class file instead of the .java file. How can I set to open the .java file under MyLibSrc? There are times when I may actually want to edit the .java file when navigating to it.

解决方案

Just right click on your project, go to properties and under source tab in java build path add your Java files of your Jar.. Should work like that.. try both the options.. forgot which one used to work.. did it long back.. all the best

这篇关于如何导航到.java文件,而不是类路径中指定的源路径的.class文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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