Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/379.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 如何在Netbeans中打开JAR进行编辑_Java_Jar - Fatal编程技术网

Java 如何在Netbeans中打开JAR进行编辑

Java 如何在Netbeans中打开JAR进行编辑,java,jar,Java,Jar,我制作了一个JAR文件。很好。我一直在修补源代码,但我忘了做了哪些更改。现在这不起作用了。我可以从Jar中提取.java吗?Jar只包含.class文件,这些文件是从.java源文件编译而来的。不幸的是,您无法编辑.class文件并期望从中得到任何有用的东西 不过,这可能是可行的:JAR反编译器。JAR只包含.class文件,这些文件是从.java源文件编译而来的。不幸的是,您无法编辑.class文件并期望从中得到任何有用的东西 不过,这可能是可行的:JAR反编译器。JAR文件类似于zip文件,

我制作了一个JAR文件。很好。我一直在修补源代码,但我忘了做了哪些更改。现在这不起作用了。我可以从Jar中提取.java吗?

Jar只包含.class文件,这些文件是从.java源文件编译而来的。不幸的是,您无法编辑.class文件并期望从中得到任何有用的东西


不过,这可能是可行的:JAR反编译器。

JAR只包含.class文件,这些文件是从.java源文件编译而来的。不幸的是,您无法编辑.class文件并期望从中得到任何有用的东西


不过,这可能是可行的:JAR反编译器。

JAR文件类似于zip文件,您可以提取内容。从oracle网站从命令行中提取(您也可以使用类似7zip的程序):

用于提取JAR文件内容的基本命令是:

jar xf  jar-file [archived-file(s)]
让我们看看这个命令中的选项和参数:

The x option indicates that you want to extract files from the JAR archive.
The f options indicates that the JAR file from which files are to be extracted is specified on the command line, rather than through stdin.
The jar-file argument is the filename (or path and filename) of the JAR file from which to extract files.
archived-file(s) is an optional argument consisting of a space-separated list of the files to be extracted from the archive. If this argument is not present, the Jar tool will extract all the files in the archive.

注意:jar文件可以包含任何类型的文件,而不仅仅是.class文件。

jar文件类似于zip文件,因为您可以提取内容。从oracle网站从命令行中提取(您也可以使用类似7zip的程序):

用于提取JAR文件内容的基本命令是:

jar xf  jar-file [archived-file(s)]
让我们看看这个命令中的选项和参数:

The x option indicates that you want to extract files from the JAR archive.
The f options indicates that the JAR file from which files are to be extracted is specified on the command line, rather than through stdin.
The jar-file argument is the filename (or path and filename) of the JAR file from which to extract files.
archived-file(s) is an optional argument consisting of a space-separated list of the files to be extracted from the archive. If this argument is not present, the Jar tool will extract all the files in the archive.

注意:jar文件可以包含任何类型的文件,而不仅仅是.class文件。

提取jar将只提供.class文件。您仍然可以尝试从.class文件生成源代码


虽然提取jar只会得到.class文件,但结果并不是100%保证的。您仍然可以尝试从.class文件生成源代码


虽然右键单击源文件的选项卡并选择History.IntelliJ(),但结果不能100%保证。如果需要反编译一组java类,请按照上的讨论进行操作。右键单击源文件的选项卡并选择History.IntelliJ()。如果您需要反编译一组java类,请按照上的讨论进行操作。虽然编译器在某些语法上有一些自由,但这很好地发挥了作用,因此将其翻译回去也反映了上述自由。谢谢。虽然编译器对某些语法有一定的自由,但这很好地工作了,所以将其翻译回去也反映了上述自由。谢谢