I read the Java tutorials on Sun for JAR files, but I still can’t find a solution for my problem. I need to use a class from a jar file called jtwitter.jar, I downloaded the file, and tried executing it (I found out yesterday that .jar files can be executed by double clicking on them) and Vista gave me an error saying ‘Failed to load Main-Class Manifest attribute from [path]/jtwitter.jar’.
The guy who coded the .jar file wants me to import it, but where do I store the .jar file to import it in my code? I tried putting both the .jar file and my .java file in the same directory, didn’t work.
The file I’m trying to work for is here: http://www.winterwell.com/software/jtwitter.php
I’m using JCreator LE.
Not every jar file is executable.
Now, you need to import the classes, which are there under the jar, in your java file. For example,
If you are working on an IDE, then you should refer its documentation. Or at least specify which one you are using here in this thread. It would definitely enable us to help you further.
And if you are not using any IDE, then please look at javac -cp option. However, it’s much better idea to package your program in a
jarfile, and include all the requiredjars within that. Then, in order to execute yourjar, like,you should have a
META-INF/MANIFEST.MFfile in yourjar. See here, for how-to.