How can I navigate to a .java file instead of a .class file with sourcepath specified in the classpath?

廉价感情. 提交于 2020-01-04 02:20:07

问题


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.


回答1:


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



来源:https://stackoverflow.com/questions/12203584/how-can-i-navigate-to-a-java-file-instead-of-a-class-file-with-sourcepath-spec

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!