1

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?

3

1 Answer 1

1

Use java.util.jar package for this work.

Sign up to request clarification or add additional context in comments.

3 Comments

The java.util.jar package has some very good uses. This is not one of them.
yep, this is not right. Use Jar tool, it's messy but that's the way. Better use some smart tool like ANT or Maven.
is there any example for the same available ? couldnt get through API only things are not getting clear :(

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.