Home > Back-end >  Jar bundles run can not find the main class Error: Could not find or load a main class xx
Jar bundles run can not find the main class Error: Could not find or load a main class xx

Time:05-26

Idea can be run directly, in order to the mistake I have deleted all engineering of the main, only this one main

Tried all kinds of packaging method, maven maven - assembly - the plugin, the idea of the build artifacts, typed jars are can not find the main class
Direct use of Java - jar xx. Jar command, Error Error: Could not find or load a main class com. XXXX (my main class name)
Using Java - cp xx. Jar com. Xx, xx is still at the same wrong

The jar package after decompression can be in the folder to find the main class xx. Class files

1. I MANIFEST. MF set up Main - Class
2. Set up in the pom mainClass

 

Maven - assembly - plugin
3.1.1 & lt;/version>


The jar - with - dependencies



Com. Xx. Xx





The make - assembly
Package

Single






To solve the what reason can not find the main class

CodePudding user response:

You pack with the install maven LifeCycle is also a similar situation with you, before I do it

CodePudding user response:

The original poster is the problem solved, please
  • Related