I am unable to understand the reason behind the error.I want to convert .class file to jar file,
on dos i write :
java cf myjar.jar *.class
but here is what i get in return:
Error: Could not find main class cf
Exception in thread “main”
java.lang.NoClassDefFoundError: cf
—and goes on,,,,
Why i am getting this error and what is it?
You’re running the wrong command –
javainstead ofjar. That’s why it’s treatingcfas a class name.You want: