如何在包含Eclipse代码的jar文件中浏览源代码? [英] How can I browse the source code in a jar file containing source code in Eclipse?

查看:149
本文介绍了如何在包含Eclipse代码的jar文件中浏览源代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含源代码的jar文件。如何在Eclipse中浏览此源代码?



目前,我的Eclipse在文本编辑器中打开了jar文件,并没有什么帮助。



当我查看常规>编辑器>文件关联时,我没有关联 *。jar 如果我查看可用的编辑器,我找不到似乎适合jar文件的任何人。



我如何浏览使用Eclipse的jar文件中的源代码?有没有我应该为jar文件配置的编辑器?

解决方案

在某些源目录中提取jar(它是一个zip文件)并创建一个具有此目录的项目作为源。



或者,如果此源jar文件包含用作Eclipse项目中的库的类jar文件的源,右键单击此jar文件,选择属性,然后选择Java源附件,然后选择外部文件,然后选择源jar文件。然后每次从这个类jar文件浏览一个类时,Eclipse会自动显示你的源代码。


I have a jar file that contains source code. How can I browse this source code in Eclipse?

At the moment, my Eclipse opens the jar file in a Text Editor, and it isn't that helpful.

When I look in the preferences "General" > "Editors" > "File Associations" I have no associations for *.jar and if I look in the available "Editors" I can't find anyone that seem to be a good fit for jar files.

How can I browse the source code in a jar file using Eclipse? Is there any Editor I should configure for jar files?

解决方案

Extract the jar in some source directory (it's a zip file), and create a project with this directory as source.

Or, if this source jar file contains the sources of a classes jar file that is used as a library in your Eclipse project, just right-click on this jar file, select "Properties", then "Java Source Attachment", then "External File", and select the source jar file. Then each time you browse a class from this classes jar file, Eclipse will automatically show you its source code.

这篇关于如何在包含Eclipse代码的jar文件中浏览源代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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