I have created a jar using IntelliJ version 14.0.2 but when I try to run the jar then I am getting an Error as Failed to load Main class manifest from //ABC.jar
Asked
Active
Viewed 314 times
0
-
1It is not a very good idea in general to use your IDE to generate jars; you should learn to use a build system such as gradle. As to your problem, it means that the generated jar misses a `Main-Class` attribute in its `META-INF/MANIFEST.MF`. Finally, you don't tell how you "run the jar". – fge Nov 25 '15 at 09:01
-
https://stackoverflow.com/questions/9689793/cant-execute-jar-file-no-main-manifest-attribute/40699577 – Yash P Shah Jan 26 '18 at 19:02
1 Answers
0
The MANIFEST in your jar does not contains main class propety something like Main-Class: org.houseofbadger.utils.dbutils.SqlQueryRunnerMain, also the property Class-Path is very useful something like Class-Path: ../lib/junit-4.11.jar ../lib/hamcrest-core-1.3.jar ../lib/ commons-lang-2.6.jar ../lib/commons-lang3-3.0.jar ../lib/log4j-1.2.12 .jar ../lib/commons-cli-1.0.jar ../lib/commons-logging-1.0.jar ../lib /commons-configuration-1.10.jar ../lib/ojdbc6-11.2.0.jar ../lib/commo ns-io-2.4.jar

Alexander
- 342
- 4
- 14