When you export a normal jar package using eclipse before the project is released, if the configuration is not good, the Java -jar /test.jar
following three types of error messages may appear when you run the command:
1. The no main manifest attribute, in /test1jar
Main method is not specified;
2. The Error: Could not find or load main class
Main method is not specified;
3. Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/kafka/common/utils/Utils.
the introduction class was not found because of a lack of dependent jar packages
There are a number of ways to export an Eclipse project with an external package jar package on the web, there are two main categories:
1. Change manifest file, this method is more complex, and there will be some problems;
2. Package with fat jar, but now that the company is closed and not serviced, the download is unsuccessful and the process of deploying the Eclipse plugin is time-consuming.
This article introduces a simple and easy-to-operate eclipse-with-a-jar package that can be packaged into an external dependency package, simple and efficient, in the following steps:
1. Right-click Project, export->java->runnable JAR file
2.->next-> Select the class that contains the main method in [Launch Configuration] and select the export path and the jar file name in [Export destination]->finish
The export is successful, and then you can deploy it directly.
How Eclipse packages jar files (with external jar packages)