如何在Eclipse中编辑Maven依赖关系中的`.class`文件 [英] how to edit `.class` file in Maven dependency in Eclipse

查看:218
本文介绍了如何在Eclipse中编辑Maven依赖关系中的`.class`文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,所以我有我的Java项目,在项目资源管理器下的Maven依赖项目文件夹下,我遇到一个 jar 文件夹,其中有一个 .class 文件。现在,我点击下载源,我可以将 .class 文件查看为Java文件,但是我不能在Eclipse中编辑它。



我该怎么办?

解决方案

您无法编辑 .class 文件。您只能编辑源代码中包含的 java 文件并重新编译。



下载的源通过 maven 是在给定时间为给定项目的 maven源插件生成的项目SNAPSHOT,以帮助调查代码,但肯定不会修改代码。



这些源可以绑定到类路径,用于在IDE中导航项目源,但它们仍然是只读的。


Ok, so I have my Java projects, and under the Maven dependency project folder on the project explorer, I encounter a jar folder, and in it there is a .class file. Now, I clicked on Download Sources and I am able to view the .class file as a Java file, but I cannot edit it in Eclipse.

What should I do?

解决方案

You cannot edit .class file(s). You can only edit java file(s) contained in the source code and recompile.

The sources that are downloaded by maven are a project SNAPSHOT generated by the maven source plugin for a given project at a given time, to aid in investigating the code, but certainly not to modify it.

These sources can be bound to the classpath and used for navigating the project source in an IDE, but they still remain read-only.

这篇关于如何在Eclipse中编辑Maven依赖关系中的`.class`文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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