使用JarJar重新打包工具 [英] using JarJar repackaging tool

查看:93
本文介绍了使用JarJar重新打包工具的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经为Google应用程序引擎部署了一个Web应用程序,并且我的Web服务使用了球衣1.14框架。当我尝试使用或调用GAE上的Web服务时,我得到一个java.lang.IncompatibleClassChangeError:Implementing类。我搜索了一下,并意识到,球衣1.14取决于asm 3.1和谷歌应用程序引擎使用asm 4.0,并意识到我不得不使用JarJar打包依赖来解决这个问题,但我不知道如何做到这一点与JarJar。我发现的教程非常神秘,面向经验程序员。所以有人可以发布面向初学者的教程,或者引导我完成解决这个问题的步骤。

解决方案

那么这是相当晚的答案,但如果有人穿越可能会有所帮助。我会举一个例子并解释这一点。 jarjar可以用来重新打包java库。它可以用来更改命名空间,例如org.apache.common.codec需要更改为some_random_name.org.apache.common.codec。从 jarjar下载网站下载jarjar,稍后粘贴您想要更改的jar文件(myinjar .jar)并将jarjar下载到一个文件夹中,然后运行以下命令: java -jar jarjar-1.4.jar process myrules.txt myinjar.jar myoutjar.jar in myrules.txt add these行

 规则org.apache.commons.codec。** some_random_name.org.apache.commons.codec。@ 1 

输出myoutjar.jar将被保存到同一个文件夹中,您可以在项目中使用它, / p>

I have deployed a web application to the Google app engine and my web service uses the jersey 1.14 framework. When I try to consume or invoke the web services on the GAE I get a java.lang.IncompatibleClassChangeError: Implementing class. I searched around and got to realize that jersey 1.14 depends on asm 3.1 and google app engine uses asm 4.0 and realize that I had to use JarJar to package the dependencies to fix this problem but I don't have a clue about how to do this with JarJar. The tutorial I found was very cryptic and geared towards experience programmers.So can someone post a tutorial that is geared towards a beginner or walk me through the steps to solve this problem.

解决方案

Well this is quite late answer, but if someone crosses by may be it would help. I will take an example and explain this. jarjar can be used to repackage java libraries. it can be used to change namespace for example org.apache.common.codec needs to be changed to some_random_name.org.apache.common.codec. Download jarjar from jarjar download site later paste the jar file you want to change (myinjar.jar) and downloaded jarjar into one folder and run this command java -jar jarjar-1.4.jar process myrules.txt myinjar.jar myoutjar.jar in myrules.txt add these lines

rule org.apache.commons.codec.** some_random_name.org.apache.commons.codec.@1

the output myoutjar.jar will be saved into same folder and you can use it in your project without any conflicts

这篇关于使用JarJar重新打包工具的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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