Make an executable jar package through IDEA

1. Usually, the project is packaged and released, and the Maven plug-in on the right side of IDEA is used to type out a springboot package and deploy it on the server.

2. In fact, you can also create an executable java package through idea. This executable jar package can be executed from the main function you specify. You can upload the jar package to the Linux server through the ava -jar package name parameter. run, fulfill your needs

Three, packaging steps

1. Right-click the project Open Module Setting

After entering, click

 The interface that comes after

Select main Class to select the mian function you want to execute

After coming out, these two options, the first is to load the third-party jar package in your project into your jar package, and the second is to put the third-party jar package in the same directory as your jar package for you jar package dependencies, generally choose the first default one 

Below MANIFEST, MF is placed in the resources directory or the src directory

 Then click confirm

Start jar package

Select Build from the menu above

Select the package to build, which is the jar package you just configured, and click build

After that, the jar package is in the out directory of the project.

 

Guess you like

Origin blog.csdn.net/qq_45171957/article/details/122082164