开发者

Refactor packages in a Jar

I have a requirement that i need to load two versions of a jar at once. To avoid class path collisions I'd like to rename the packages of one of the jars. Then in source you could always easily determine the version by the package name.

开发者_如何学CI've played with javap but couldn't find an assembler for Java 1.6. I've also attempted to decompile the code with JD but it never quite got it right and it wouldn't compile.


Another thing to consider instead of manually modifying the classes is to use some class loader magic. I've never done this myself, but have read a bit about it. There is an article on devx which explains how to load multiple versions of classes.


You can use the opensource package : JclLoader which helps in loading different versions of the same jar. This was also a need in one of our systems to do testing .

Link: http://sourceforge.net/projects/jcloader/

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜