当前位置: 代码迷 >> Java Web开发 >> log4j开源代码研究-怎么打包
  详细解决方案

log4j开源代码研究-怎么打包

热度:994   发布时间:2013-02-25 21:11:46.0
log4j开源代码研究---如何打包
最近项目需要对log4j扩展开发,需要研究源代码,改写源代码后,如何将源码打包成jar文件,我用的myeclipse,大家有没有好的方法?

------解决方案--------------------------------------------------------
jar命令试过了吗

jar cf jar-file input-file(s)

Let's look at the options and arguments used in this command:

The c option indicates that you want to create a JAR file.
The f option indicates that you want the output to go to a file rather than to stdout.
jar-file is the name that you want the resulting JAR file to have. You can use any filename for a JAR file. By convention, JAR filenames are given a .jar extension, though this is not required.
The input-file(s) argument is a space-delimited list of one or more files that you want to be placed in your JAR file. The input-file(s) argument can contain the wildcard * symbol. If any of the "input-files" are directories, the contents of those directories are added to the JAR archive recursively.

The c and f options can appear in either order, but there must not be any space between them.

http://java.sun.com/developer/Books/javaprogramming/JAR/basics/build


也可以试着拿对应版本的现存jar包将已修改的class文件进行替换
------解决方案--------------------------------------------------------
右键项目-->Export-->java-->JAR file
------解决方案--------------------------------------------------------
用反编译的软件全部反编辑之后,修改重新打包,不过整个包反编译的步骤容易出现错误。
或者把jar包用winrar打开,找到目录,把自己的工具类直接拖进去覆盖也可以的