开发者

Eclipse: Edit any .class file belonging to the jars in a project's build path and auto-generate a new class file corresponding to these edits

开发者 https://www.devze.com 2023-02-11 11:07 出处:网络
In Eclipse, I can browse through the jars( that my project depends on) and open any class file from these jars. Once I open a class file, the source corresponding to this class file will be displayed.

In Eclipse, I can browse through the jars( that my project depends on) and open any class file from these jars. Once I open a class file, the source corresponding to this class file will be displayed.

But, what I can't do is edit these files and even better, be able to auto-generate the .class corresponding to the edits I have made.

For eg., lets take the log4j library. Lets say I add it to my Project's build path; once I do that the log4j jar file is visible in my Package Explorer and I would able to browse through the class files in this jar file and be able to read any class file within the jar file. What I am trying to do is be able to edit any class file (say for eg., org.apache.log4j.Appender) and auto-generate a new class corresponding to the edits I have made on this class.

Is there a plugin that would allow me to do this ??

It would 开发者_如何学Cbe very helpful to have such a functionality especially when you are working with open-source libraries(log4j, gwt etc) and are interested in quickly testing any new functionality you would like to contribute to these open-source communities.

thanks


No.

You can view the source code because Maven downloads and attaches the source JARs for you.


No. the source you are viewing is not from the class file, it's from separate source files included in the jar (less common) or it's from another jar that contains just the source (more common). To do what you want it would need to recompile the source to the class file, and then rebuild the jar file to contain that class. It would be effectively rebuilding the entire project.

If you want to edit an open source library project you should create a new project in your workspace for it, checking out the project from version control. Then have your other project depend on this instead of the jar release.

0

精彩评论

暂无评论...
验证码 换一张
取 消