1. Start Command Prompt.
2. Navigate to the folder that holds your class files:
C:\>cd \mywork
3. Set path to include JDK’s bin. For example:
C:\mywork> path c:\Program Files\Java\jdk1.7.0_25\bin;%path%
4. Compile your class(es):
C:\mywork> javac *.java
5. Create a manifest file and your jar file:
C:\mywork> echo Main-Class: Craps >manifest.txt
C:\mywork> jar cvfm Craps.jar manifest.txt *.class
or
C:\mywork> jar cvfe Craps.jar Craps *.class
6. Test your jar:
C:\mywork> Craps.jar
or
C:\mywork> java -jar Craps.jar
2. Navigate to the folder that holds your class files:
C:\>cd \mywork
3. Set path to include JDK’s bin. For example:
C:\mywork> path c:\Program Files\Java\jdk1.7.0_25\bin;%path%
4. Compile your class(es):
C:\mywork> javac *.java
5. Create a manifest file and your jar file:
C:\mywork> echo Main-Class: Craps >manifest.txt
C:\mywork> jar cvfm Craps.jar manifest.txt *.class
or
C:\mywork> jar cvfe Craps.jar Craps *.class
6. Test your jar:
C:\mywork> Craps.jar
or
C:\mywork> java -jar Craps.jar
No comments :
Post a Comment