IDEA packages part of the class files into jars to use small notes
Dingdu! Here is the compilation of Xiao Ah Woo's study course materials. A good memory is not as good as a bad pen. Today is also a day to make progress. Let's advance together!
I. Introduction
有时候有太多模块堆放一块比较混乱,
将某个功能所需要的模块打包成jar使用起来会方便点。
2. IDEA packages some class files into jars
The steps are as follows:
File-> Project Structure
Artifacts-> + -> JAR -> Empty
关于Name,根据自己情况自行设定。
Choose Empty, and then name the jar you typed
Then IS10-4
right-click on it to create a directory as shown in the figure.
Then create a module on the com module
Then create...The
final structure diagram is as follows: 【Created according to your actual situation, here is only for demonstration. 】
The next step is to add the main, ui, and util packages 添加对应的class文件
.
Click the + sign to select file, and select the class file in the corresponding module after your project is compiled, usually out模块
below.
After adding the corresponding class file, click apply, ok. Perform the last step to package the jar.
Choose to recompile the module you just created, and the last generated jar is in the one you selected when you created the jar output directory地址
.
The previous output address:
Finally, directly use the generated jar as a third-party jar into the project.
Ending!
More course knowledge learning records will come later!
就酱,嘎啦!
Note:
Life is diligent, nothing is gained.