Varun
Varun

Reputation: 5061

Create a jar file from the java code

i want to create a jar file from java program i looked at some examples Java code to create a JAR file but it didnt impressed me as this will not create the proper package structure my original command was

jar -cfv formBuilder.jar .\com\accenture\* .\com\wysiwyg\util\XmlUtil.class  .\com\wysiwyg\exception\ApplicationException.class .\com\wysiwyg\constants\*.class .\com\wysiwyg\util\FormBuilderUtill.class .\com\wysiwyg\util\SaveFormOnLocalUtil.class .\com\wysiwyg\logger\LogInfo.class  .\com\wysiwyg\factory\Validation.class 

now i want to do the same using java code but without ant, and proper package structures should be created, is this feasible?

Upvotes: 1

Views: 1205

Answers (1)

Amit
Amit

Reputation: 465

Use java.util.jar package for this work.

Upvotes: 1

Related Questions