gpt4 book ai didi

java - 在netbeans ide中仅创建项目的一个包的jar文件

转载 作者:行者123 更新时间:2023-12-01 15:16:59 25 4
gpt4 key购买 nike

我会创建一个仅包含一个属于我的项目的包的 jar。这个包包含一个主类。我该怎么办?

最佳答案

来自jar documentation :

jar cf jar-file input-file(s)

...
* The input-file(s) argument is a space-separated list of one or more files that you want to include 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.

因此您可以将路径指定为包:

jar cf <jar file name> com/companyname/package/ 

关于java - 在netbeans ide中仅创建项目的一个包的jar文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11483473/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com