4/21/13

Creating a jar File in Command Prompt


Creating a jar File in Command Prompt

This one is the way to make your java program become executable as jar file.

Start Command Prompt.
  1. Navigate to the folder that holds your class files:
    C:\>cd \mywork
    
    
  2. Set path to include JDK’s bin.  For example:
    C:\mywork> path c:\Program Files\Java\jdk1.5.0_09\bin;%path%
    
    
  3. Compile your class(es):
    C:\mywork> javac *.java
    
    
  4. Create a manifest file:
    C:\mywork> echo Main-Class: DanceStudio >manifest.txt
    
    
  5. Create a jar file:
    C:\mywork> jar cvfm DanceStudio.jar manifest.txt *.class
    
    
  6. Test your jar:
    C:\mywork> DanceStudio.jar
    
    
    http://www.skylit.com/javamethods/faqs/createjar.html

No comments:

Post a Comment