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?

Community
  • 1
  • 1
Varun
  • 5,001
  • 12
  • 54
  • 85
  • 1
    Oracle (Sun) doucument can't be more detailed. Go through: http://download.oracle.com/javase/tutorial/deployment/jar/ More precisely, http://download.oracle.com/javase/tutorial/deployment/jar/build.html – Nishant Mar 14 '11 at 06:01
  • @Nishant - i know using it from command line but wanna do it from my java code – Varun Mar 14 '11 at 07:21
  • oh, in a glance, it is not clear that it is what you want. – Nishant Mar 14 '11 at 07:28

1 Answers1

1

Use java.util.jar package for this work.

Amit
  • 466
  • 6
  • 11