Quantcast
Channel: JetBrains Developer Community : Thread List - IntelliJ IDEA Users
Viewing all articles
Browse latest Browse all 5661

How to create executable JAR using Intellij ?

$
0
0

Hi,

I am using Intellij IDEA 12.1.3 on MAC OS X 10.8.3 to create an executable 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

 

I check the MANIFEST.MF file in the jar file it indeed does not have Main-Class entry.

Using Maven by adding the <build> section to pom.xml sucesfully creates working jar.> mvn assembly:assembly

 

Thanks


Viewing all articles
Browse latest Browse all 5661

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>