idear packaging report: There is no main manifest attribute in jar
- One of the methods for java to generate executable jar files:
1.1 (1) InteliJ IDEA menu bar File—>Project Structure—>Artifacts—>"+"Operation—>Select JAR—>Select "From modules with dependencies...", as follows :
Click to add jar package,
select the second one
, select your project, your main method
The most important thing is to choose a Main Class, and then the system defaults to modify the path of META-INF/MANIFEST.MF to src (be careful not to put it in the main/java directory, otherwise META-INF/MANIFEST. MF does not contain Main Class information, and when generating an executable jar, it will prompt that there is no main list attribute) By default, the
second-level directory behind X:\your project directory\src\main\java needs to be deleted! ! ! ! !
- Add a Module Output, this key, must have, otherwise
Save after adding
- After completing the above steps, select Build Artifacts in the IntelliJ IDEA menu column and build. If there is no accident, the corresponding jar package file will be generated under your project. The default location is in the directory out/artifacts/${project Name}, and then run it directly on the terminal:
the decompressed jar package looks like this.
So far, execute java -jar ×××.jar and you can see the output
Welcome to leave a message