当前位置:网站首页>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
边栏推荐
猜你喜欢

7. Dichotomy -- find a set of repeated or ordered but rotating arrays

记录一次idea中的父子项目修改project与module名称,亲测!

【栈的应用】--- 中缀表达式转后缀表达式

django-celery-redis异步发邮件

IDEA打包jar包及运行jar包命令

5. Dynamic programming -- Fibonacci series

uni-app项目目录、文件作用介绍 及 开发规范

Match file names from file paths using regular expressions

Typora使用教程

SQL Server 2016 学习记录 --- 嵌套查询
随机推荐
Qt | 信号和槽的一些总结
Go 内存模型 (2014年5月31日版本)
5. Dynamic programming -- Fibonacci series
Double pointer technique
16、字符串反转
Prometheus operation and maintenance tool promtool (IV) TSDB function
Uni app advanced creation component / native rendering
10、链表中倒数第k个节点
Vulnerability analysis hevd-0x8.integeroverflow[win7x86]
阿里云镜像地址
10. The penultimate node in the linked list
Massive data topn problem
The IPO of SMIC International Technology Innovation Board passed smoothly, and its market value is expected to exceed 200billion!
Context values traps and how to avoid or mitigate these traps in go
django-celery-redis异步发邮件
简介
Typora tutorial
API 网关 APISIX 在Google Cloud T2A 和 T2D 的性能测试
发力大核、独显!英众科技2020十代酷睿独显产品发布
8、数组中出现次数超过一半的数字