如何导航到.java文件,而不是类路径中指定的源路径的.class文件? [英] How can I navigate to a .java file instead of a .class file with sourcepath specified in the 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屋!