1 Introduction
Sometimes we encounter a jar package that contains multiple class files in a project. Here is how IDEA creates a jar package (non-module).
2. Problem solving
2.1. Step one: Select Project Structure in the upper right corner
Method one:
Method two:
2.2. The second step
2.3. Create a new empty jar. The default name is unnamed. You can change the name of the jar package according to your own needs.
2.4. Click New Directory in the upper left corner to create a new directory, and then create a new directory.
2.5. The newly created directory structure must be consistent with the directory structure of the project.
2.6. Select “+”–>File
2.7. Note that the selected file is a compiled .class file. Select one or more as needed. After adding the file, select "Apply"->"OK"
2.8. Select Build–>Build Artifacts… in the upper left corner
2.9. Select the newly created jar, Build/Rebuild is available.
2.10. Find the jar you just typed in the file.
2.11 If you can't find it, you can create a new jar. There is an Output directory, which is the file directory where the jar is located.