当前位置:网站首页>How does idea package its own projects into jar packages
How does idea package its own projects into jar packages
2022-06-25 21:41:00 【Xili xiaozhuge】
idea How to package your project into jar package
One 、 Ideas
First, prepare two projects to establish two , A project as provided jar The works of the package , Another project as a call jar The works of the package .( Pay attention to idea The project document in is moudule, instead of project,project It's the workspace ).
Two 、 Create a provider jar Project of the package
1. So let's set up a moudule project , And create a new department class (Dept.java).
2. open Project Structure, Do the following :( Shortcut key ctrl+alt+shift+s)
① choice Artifacts, Click on + Number , Create a new empty one jar Package file 
② to jar File naming ( english ), And pack you into jar The works of the package , Drag to the newly named jar On the bag .

③ The following structure will appear , Then apply .
④ Because we just changed Artifacts Set up , Now we need Build Artifacts. Click on Buid-Buid Artifacts. 
Then choose what we want Buid Of jar package .
⑤ Go back to the Project Structure Found exported in jar The path of the package , Then in the corresponding path of our computer , We can find the jar It's packed .

3、 ... and 、 Create a project call jar package , Use jar Class files in the package .
1、 The creation of the project is similar to that before . Under the new project , We build a new one TestMain class , Used to test whether it can call Previous export jar In bag Dept class . The specific steps are as follows :
① Copy secondjar.jar package , Paste into call jar Under the project of the package 
② Right click secondjar.jar, Click on Add as Library.
③ Then click OK , Now it is added successfully , You can call the classes in the package .
边栏推荐
- 北工大毕业时用的一些网址
- 挖财证券开户安全嘛?
- [nailing - scenario capability package] nailer card
- Website judges network connection disconnection, JS judges network connection disconnection, best practice
- Win11开始菜单右键空白?Win11开始菜单右键没反应解决方法
- Q5 s905l firmware version 202109
- org. apache. ibatis. exceptions. PersistenceException:
- CANoe. Diva operation guide TP layer test
- The robotframework executes JS commands to move the mouse from X to y
- HNU计网实验:实验五 网络层与链路层协议分析(PacketTracer)
猜你喜欢

C language dynamic memory allocation

Volatile qualifier

04 disk space management

01 network basics

The latest (2022-2-16) vulnerability of WordPress plug-in bee collection (XSS, WordPress user name exposure, arbitrary article publishing) is repeated

The difference between strcpy and memcpy

Explain memcached principle in detail

Mathematical analysis_ Notes_ Chapter 4: continuous function classes and other function classes

JS disable the browser PDF printing and downloading functions (pdf.js disable the printing and downloading functions)

IPv4 and IPv6 (powercert animated videos)
随机推荐
How to solve the problem of flash write protection in STM32?
Website judges network connection disconnection, JS judges network connection disconnection, best practice
multiplication table
Sqlmap for interface security testing
ECU test modify test case
Multi database and multi table backup and restore of MySQL under Linux
UDP Vs TCP (Powercert animated videos)
Windows11 windows security center cannot open Windows Defender cannot open
Weed FS stress test
Legal mix of settlements (utf8mb4_0900_ai_ci, implicit) and (utf8mb4_general_ci, implicit) error resolution
Shell syntax
The latest (2022-2-16) vulnerability of WordPress plug-in bee collection (XSS, WordPress user name exposure, arbitrary article publishing) is repeated
Beginner to embedded development
Win11开始菜单右键空白?Win11开始菜单右键没反应解决方法
24 张图一次性说清楚 TCP
【hnu暑学期】数据库系统设计 准备阶段
【Proteus仿真】Arduino UNO花样流水灯
Canoe learning notes (2)
Pytest assert encapsulation
Understand two major web development patterns