top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How to convert java class or project to jar file ?

+1 vote
532 views
How to convert java class or project to jar file ?
posted Mar 18, 2014 by Anand Kalagi

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

Please follow the provided steps, and let me know if need further help -

Start Command Prompt and Navigate to the folder that holds your class files:
C:> cd \mywork

Set path to include JDK’s bin. For example:
C:\mywork> path c:\Program Files\Java\jdk1.5.0_09\bin;%path%

Compile your class(es):
C:\mywork> javac *.java

Create a manifest file:
C:\mywork> echo Main-Class: DanceStudio >manifest.txt

Create a jar file:
C:\mywork> jar cvfm DanceStudio.jar manifest.txt *.class

Test your jar:
C:\mywork> DanceStudio.jar

answer Mar 18, 2014 by Salil Agrawal
Similar Questions
+1 vote

How to create frameworks in java and how can I use framework in .class file for my project?

+3 votes

I want to write a Makefile that compiles. My question here is how to add an external library using Make syntax?

0 votes

I run my code in Eclipse IDE and its fine. I have export it as jar file from Eclipse and run on terminal as jar file, it generates Error: java.lang.NullPointerException. Could not understand why is it so.

...