IntelliJ IDEA jar package

IntelliJ IDEA jar package


Try this first: menu Build > Build Artifacts... > Build

At this time, a jar package will be generated in the ./out/artifacts/project name/ directory.


-----------------------------------------------------------------------------------------------------


If the Build Artifacts... display is gray and unclickable, try the following:

1.File > Project Settings:Artifacts > "+" > jar > From Modules with... 



2. Then select Module and Main Class and click OK. If there is no Main Class, you do not need to fill in


3. Finally click OK



4. At this time, META-INF/MANIFEST.MF will be generated in the project, copy this folder to the main/resources/ folder


5.Build > Build Artifacts... >Build

At this time, a jar package will be generated in the ./out/artifacts/project name/ directory


If there is a main function in the jar, you can use this java -jar XXX.jar to start the main in the jar package




Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325640146&siteId=291194637