Tag Archives: main

Java error: unable to find or load the main class

1、 Problem
today, copy the code of idea to eclipse for execution, and then report an error: “error: unable to find or load the main class”;

2、 The solution
can be executed in idea and can be executed in eclipse, which means that there is no problem with the code. The only problem is the running environment. After checking the configuration, the problem is found:

here is an error in Maven dependency:

what the hell pom.xml Log off the error reporting dependency in the file, and then run the main method;

When jar file is running: Failed to load Main-Class manifest attribute from ……Solution

The original address is:
Jar file runtime: Failed to load main-class manifest Attribute from… The solution

Failed to load main-class manifest Attribute from… , which is caused by the unset program entry program. Open the JAR file with WinRAR, expand the meta-INF folder, and check the MANIFEst.MF file. It can be found that main-class is not set, which is the reason of the exception.

reprint please indicate this article address:
Jar file runtime: Failed to load main-class manifest Attribute from… The solution