I have to write a program for a class I’m taking, and he gave us an executable jar to run and compare our results with his.
However, I’m having trouble running it, even after reading some other related topics. I am given absolutely nothing else but the jar, which I can’t extract.
I just want to run it somehow – either in a shell or on Eclipse.
==
Sorry for the lack of specifics:
It says I’m missing the Main-Class manifest attribute. I know when this happens you should go into the manifest and from picking around, I did notice that the manifest did NOT contain that attribute. I added it, but whenever I try to use jar uvf to add it back in, it just ignores it.
“jar uvf EditDistance.jar META-INF/
ignoring entry META-INF/
ignoring entry META-INF/MANIFEST.MF ”
Help please? :/
It is possible you were not given an executable jar. You may have to use jtahlborn’s solution. If you can’t figure out what to use for com.example.MainClass, you can try
This will give you a list of all files in the jar. Hopefully one is called either EditDistance.class or Main.class (with some prefix, so: “com/example/EditDistance.class”).
If you see something like that, just translate slashes to dots, drop the .class suffix, and plug that in to jtahlborn’s solution: