我会创建一个仅包含一个属于我的项目的包的 jar。这个包包含一个主类。我该怎么办?
最佳答案
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/