I am using Intellij IDEA 12.0.4 on MAC OS X 10.8.3 to create a jar file.
I go to File -> Project Structure -> Artifacts -> + -> Jar -> From modules with dependencies -> Selected Main Class after browsing -> selected extract to the target jar -> Directory for META-INF automatically gets populated -> OK -> Apply -> OK -> Build -> Build Artifacts -> Build
Now If I try to run jar using:
java -jar path_to_jar/jar_file
I get this error
no main manifest attribute, in path_to_jar/jar_file
$ java -version
java version "1.7.0_17"
Java(TM) SE Runtime Environment (build 1.7.0_17-b02)
Java HotSpot(TM) 64-Bit Server VM (build 23.7-b01, mixed mode)
Any pointers, what I am doing wrong?