简体   繁体   English

如何导航到.java文件而不是类路径中指定了sourcepath的.class文件?

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

I have a prebuilt jar under my project's libs folder to speed up build-time. 我在项目的libs文件夹下有一个预构建的jar,以加快构建时间。 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: 但是,我想在导航到其中一个包含的类时浏览lib的源代码,因此将以下行添加到.classpath:

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

Where MyLibSrc contains the source for mylib.jar. MyLibSrc包含mylib.jar的源。 When I navigate into one of the lib's classes, Eclipse opens the corresponding .class file instead of the .java file. 当我导航到其中一个lib类时,Eclipse会打开相应的.class文件而不是.java文件。 How can I set to open the .java file under MyLibSrc? 如何设置在MyLibSrc下打开.java文件? There are times when I may actually want to edit the .java file when navigating to it. 有时我可能真的想在导航到它时编辑.java文件。

在此输入图像描述

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构建路径的源选项卡下添加您的Jar的Java文件。应该这样工作..尝试两个选项..忘记哪个曾经工作..做了很久回来..一切都好

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM