Mazzy
Mazzy

Reputation: 14179

create jar file of only one package of a project in netbeans ide

I would create a jar of only one package belonged to my project. this package contains a main class.how can I do?

Upvotes: 0

Views: 999

Answers (1)

plasma147
plasma147

Reputation: 2211

From the 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.

So you could just specify your path as a package:

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

Upvotes: 1

Related Questions