I made a simple swing application and packaged it in the same directory by the name MyJAR.jar.
Using the jar command on the command line, this is what i got: D:\java_programs\swingClass>jar cvf D:\java_programs\swingClass\MyJAR.jar D:\java_programs\swingClass\*.* added manifest adding: D:/java_programs/swingClass/MySwingClass.class(in = 1153) (out= 680)(def lated 41%) adding: D:/java_programs/swingClass/MySwingClass.java(in = 705) (out= 355)(defla ted 49%)
The JAR is created successfully in the same folder.
However, when I try to run the jar directly, I get the following:
D:\java_programs\swingClass>java -jar MyJAR.jar Failed to load Main-Class manifest attribute from MyJAR.jar
Why is this happening ? Any clues ? Am I missing something ? Please guide.