如何将多个类文件转换成一个jar文件? [英] How to convert multiple class files to one jar file?
问题描述
我已经反编译一个jar文件,
I have decompiled a jar file,
和用它制成的两班。在那之后,我试图让这两个类文件的新的JAR文件,使用这种code
and made two classes from it. After that, I tried to make a new jar file with these two class files, using this code
jar cvf AB.jar WinRegistry.class StartPageChangeApplet.class
没有任何错误创建的文件。然而,当我看到关于Java反编译器源$ C $ C,它说:个内错误,意味着我不能让jar文件正确。
The file created without any errors. However, when I look at the source code on Java Decompiler, it says "Internel Error", means that I couldn't make the jar file properly.
我在哪里做做错了吗?
推荐答案
请界定用它制成的两班。其中java编译器(例如器javac.exe)您使用的?你刚才源复制到一个.class文件没有可能在编译?
Please define "made two classes from it". Which java compiler (e.g. javac.exe) are you using? Did you just copy the source to a .class file without compiling maybe?
化java反编译JAD实际显示源$ C $ C,不是阶级字节code。不要被编辑这是说 WinRegistry.class
标题混淆。
The java decompiler JAD actually displays source code, not class bytecode. Don't get confused by the title of the editor which is saying WinRegistry.class
.
所以,你不能只保存为的.class
。您需要使用Java编译器将其保存为的.java
,然后将其编译成的.class
:
So you can't just save that as a .class
. You need to save it as a .java
and then compile it to .class
using a java compiler:
javac WinRegistry.java StartPageChangeApplet.java
jar cf AB.jar WinRegistry.class StartPageChangeApplet.class
这篇关于如何将多个类文件转换成一个jar文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!