2012-07-14 60 views
0

我會創建一個jar包,只包含屬於我的項目的一個包。這個軟件包包含一個主要類,我可以做什麼?在NetBeans IDE中創建一個項目的唯一一個包的jar文件

+0

呃,用'jar'命令? – 2012-07-14 11:48:14

+0

你想讓jar運行嗎? – plasma147 2012-07-14 11:55:30

+0

是的,我會罐子運行。我的意思是我有一個項目與許多包。我會創建只有一個包含主包的jar。 – Mazzy 2012-07-14 12:00:17

回答

1

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/ 
相關問題