The following takes the hello world program as an example to illustrate the packaging process.
Artifacts Config
File -> Project Structure -> Artifacts -> + -> From modules …
Build Artifacts
Build -> Build Artifacts
important point
If the project structure does not correspond, the main file cannot be found, and the path needs to be adjusted manually.
Such as maven project.
The following two pictures are from the Internet
before fixing
after modification