java 你如何修改eclipse中的可执行jar类?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10095250/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
how do you modify executable jar classes in eclipse?
提问by Edmund Rojas
Im attempting to follow a tutorial here that will help me to modify some source code from the twitter4j executable jar to allow me to use twitters native image upload api, unfortunately Im having a tough time figuring out how this is done because these files arent allowing me to edit them at all in eclipse, here is the tutorial im followingseems pretty straight forward but the author didnt include the step of how to edit the files assuming this was common knowledge I can only assume.
我试图按照这里的教程来帮助我修改 twitter4j 可执行 jar 中的一些源代码,以允许我使用 twitters 本机图像上传 api,不幸的是,我很难弄清楚这是如何完成的,因为这些文件不允许我要在 Eclipse 中完全编辑它们,我接下来的教程看起来很简单,但作者没有包括如何编辑文件的步骤,假设这是我只能假设的常识。
回答by Nathaniel Ford
You have two options open to you.
您有两种选择。
1) Get the original source code, and package the jar after making your changes.
1) 获取原始源码,修改后打包jar。
2) Unzip the jar (any standard unzipping program should do), make your changes and then repackage the jar.
2) 解压 jar(任何标准解压程序都应该这样做),进行更改,然后重新打包 jar。
That said, perusing those links (I didn't go very in depth) suggests that those are libraries you can use - not libraries you are required to modify to get to work. What are you trying to achieve by modifying the library?
也就是说,仔细阅读这些链接(我没有深入研究)表明这些是您可以使用的库 - 而不是您需要修改才能开始工作的库。你想通过修改库来实现什么?