简体   繁体   English

如何将文件夹变成jar文件

[英]How to turn a folder into jar file

Is there any idea how can I turn a folder into jar file using batch file I looked on the internet and I found somthing like: 有什么主意,如何使用我在网上看到的批处理文件将文件夹转换为jar文件,发现类似以下内容:

jar cvf program.jar -C path/of/class/files

But I won't to list all class files Thanks 但我不会列出所有课程文件,谢谢

Take a look at http://docs.oracle.com/javase/7/docs/technotes/tools/windows/jar.html . 看看http://docs.oracle.com/javase/7/docs/technotes/tools/windows/jar.html

It explains how to use the jar tool. 它说明了如何使用jar工具。 -C dir simply changes the current working directory to dir and should be followed by inputfiles -- so maybe -C path/of/class/files . -C dir只是改变当前的工作目录到dir和应遵循的inputfiles -所以也许-C path/of/class/files . fixes your situation? 解决您的情况? Another option you could try would be to remove -C altogether and just state path/of/class/files as inputfiles , that should actually recursively traverse this directory and add everything. 您可以尝试的另一种选择是完全删除-C ,仅将path/of/class/filesinputfiles ,这实际上应该递归遍历此目录并添加所有内容。

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

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