简体   繁体   English

从文件夹制作jar文件

[英]Make jar file from folder

i have a folder on my desktop named theme.I am new to Linux totally. 我在桌面上有一个名为主题的文件夹。我完全不熟悉Linux。 So what do I do to create a jar file from this folder? 那么如何从该文件夹创建jar文件呢? I found this example but It doesn't work for me. 我找到了这个示例,但对我而言不起作用。

jar -cvf theme.jar jar -cvf theme.jar

Jar files are really just zip files, renamed to .jar . Jar文件实际上只是zip文件,已重命名为.jar Just use any folder zipping tool (such as the zip command). 只需使用任何文件夹压缩工具(例如zip命令)。

zip -r theme.jar /path/to/desktop/theme

You are failing to specify the input files for the jar. 您无法为jar指定输入文件。

Navigate to the theme/ directory using the cd command in Terminal. 在终端中使用cd命令导航到theme /目录。 If you want to include everything in this directory in your jar file, use the following command. 如果要在jar文件中包括此目录中的所有内容,请使用以下命令。

jar cvf theme *

Note that the * character (wildcard) indicates you want to include all files and subdirectories. 请注意, *字符(通配符)表示您要包括所有文件和子目录。

See: http://docs.oracle.com/javase/tutorial/deployment/jar/build.html 请参阅: http : //docs.oracle.com/javase/tutorial/deployment/jar/build.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM