当前位置:网站首页>Idea packages jar packages and runs jar package commands
Idea packages jar packages and runs jar package commands
2022-07-28 10:26:00 【My fruit flavor】
One 、 What is? jar package
jar package : The full name of the document Java Archive File,Java Archives :
*** Used to package class files , Easy to transplant ;
*** File format and common ZIP Compressed files are similar , Common decompression software can be used to open ;
*** By default, the file contains a file named META-INF/MANIFEST.MF The list file for , Generated by the system JAR Files are created automatically .
Tips :
jar The package is mainly for class Package files , and java Compile generated class Files are platform independent , That means jar Packages are cross platform , So you don't have to worry about specific platform issues .
Two 、 Why fight jar package
When we develop a program , There are many classes in the program , If you need to provide it to others , It's very bad to send a lot of source files to each other , Therefore, it is usually necessary to package these classes and related resource files into a jar package , Put this jar The bag is provided for others to use , At the same time, it provides users with a clear document interface . So that others get what we provide jar after , You can easily call .
3、 ... and 、IDEA How to pack jar Package and jar How packages work
Premise :
Create a folder in your project directory to store MANIFEST.MF file
Find and save idea Project code Folder >> Under the java>> Project name >>src Folder >>mian Folder >> New folder
for example :E:\code\java\rz_cms\src\main\res
Be careful : The path cannot be used IDEA Set the default path , You have to create... Manually .

1. Set packaging parameters




2. export jar package


When Progress bar After a walk , There will be one more... In the project directory out Folder , What is stored in it is to use IDEA Derived jar package
3、 function jar file

stay E:\code\java\rz_cms\out\artifacts\rz_cms_jar

Input cmd Use the command to run jar file
javaw -jar -Xmx1024m -Xms1024m rz_cms.jar > log.txtCommand parsing :
javaw: Background operation
java: The front desk operation
Xmx: Set up Java Initialization size of stack
Xms: Set the largest java Heap size
> log.txt: Direct the log output to log.txt in
4、 The end of the process
Query the running process with the corresponding port number
netstat -ano | findstr 8070
End correspondence PID The process of
taskkill -F -PID 592
边栏推荐
- Continue to write the greatest work based on modelarts [play with Huawei cloud]
- 华为入股石墨烯材料厂商富烯科技,持股10%
- Install MySQL under centos7, and the online articles are not accurate
- 语音聊天app——如何规范开发流程?
- 【栈的应用】--- 中缀表达式转后缀表达式
- SQL Server 2016 学习记录 --- 集合查询
- Voice chat app - how to standardize the development process?
- (1) Summary of machine learning concepts
- 在mt6735中添加新的开机logo与开\关机动画
- 剑指offer
猜你喜欢
随机推荐
Hurun released the 2020 top 10 Chinese chip design private enterprises: Huawei Hisilicon did not appear on the list!
Ueeditor v1.4.3 control file compression
Prometheus 运维工具 Promtool (四)TSDB 功能
Kubernetes
剑指offer
4. Adjust the array order so that odd numbers precede even numbers
12、双指针——合并两个有序链表
3.用数组逆序打印链表
️雄关漫道真如铁,而今迈步从头越️
ACM寒假集训#6
SQL Server 2016 学习记录 --- 数据更新
MySQL的SQL TRACE一例
Double pointer technique
Troubleshooting of tool failure caused by Chinese characters in PT kill query
Redis design specification
按位与、或、异或等运算方法
IDEA打包jar包及运行jar包命令
吴雄昂遭Arm罢免内幕:建私人投资公司,损害了股东利益?
Aqua Data Studio 18.5.0导出insert语句
SQL Server 2016 learning records - View








