Reputation: 1199
I am trying to create a jar file with many classes. Using the following command
C:\Users\use\Desktop\SDE_7_SSH\eclipse\new\charge\src\jar> jar cf charge.jar *.class
But it is throwing an error 'jar' is not recognized as an internal or external command, operable program or batch file.
In my jar folder (C:\Users\use\Desktop\SDE_7_SSH\eclipse\new\charge\src\jar), i am having two other folders named "f1", "f2", which inturn having classes.
Upvotes: 1
Views: 191
Reputation: 372
You need to run the jar command from bin directory. For example on linux system, I would either go to my directory
cd /usr/local/java/jdk1.6.0_01/bin/
and then run
jar cf charge.jar *.class
or else run it with the full path of java binary
/usr/local/java/jdk1.6.0_01/bin/jar cf charge.jar *.class
Upvotes: 1
Reputation: 3560
Use the complete path to the jar program, which is in Java's bin directory. Like
jdk_with_version\bin\jar cvf *.class
Upvotes: 0