当前位置: 首页 > news >正文

官方网站弹幕怎么做青岛seo网站管理

官方网站弹幕怎么做,青岛seo网站管理,小程序项目描述怎么写,js网站建设工作中有时候偶尔写一些工具类、小程序,可是java程序员制作一个可运行jar实在折腾,利用idea开发环境,可以快速打包自己的可运行jar。具体怎么操作呢? 创建一个空白的java项目并完成自己的程序开发 完成java代码: /**…

工作中有时候偶尔写一些工具类、小程序,可是java程序员制作一个可运行jar实在折腾,利用idea开发环境,可以快速打包自己的可运行jar。具体怎么操作呢?

创建一个空白的java项目并完成自己的程序开发

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
完成java代码:

/*** 测试窗口* @author binbin* @date 2023/9/27 10:29*/
public class InfoFrame extends JFrame {public InfoFrame() {setTitle("System Information");setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);setSize(300, 200);//居中显示Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();setLocation((screenSize.width - getWidth())/2, (screenSize.height - getHeight())/2);//初始化菜单JMenuBar bar = new JMenuBar();JMenu menu = new JMenu("帮助");JMenuItem exitItem = new JMenuItem("退出");exitItem.addActionListener(e -> {System.exit(0);});menu.add(exitItem);bar.add(menu);setJMenuBar(bar);//初始化系统信息JTextArea infoTextArea = new JTextArea(6, 10);infoTextArea.setText(getSystemInfo());infoTextArea.setEditable(false);add(new JScrollPane(infoTextArea));}private String getSystemInfo() {StringBuffer b = new StringBuffer();b.append("系统系统:").append(System.getProperty("os.name")).append("\r\n");b.append("系统版本:").append(System.getProperty("os.version")).append("\r\n");b.append("系统架构:").append(System.getProperty("os.arch")).append("\r\n");b.append("用户名称:").append(System.getProperty("user.name")).append("\r\n");b.append("用户主目录:").append(System.getProperty("user.home")).append("\r\n");b.append("当前工作目录:").append(System.getProperty("user.dir")).append("\r\n");return b.toString();}
}
public class App
{public static void main( String[] args ){EventQueue.invokeLater(() -> {new InfoFrame().setVisible(true);});}
}

代码结构如下:
在这里插入图片描述

引入maven-assembly-plugin插件打包

<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"><modelVersion>4.0.0</modelVersion><groupId>org.hbin</groupId><artifactId>info</artifactId><version>1.0-SNAPSHOT</version><name>info</name><url>www.binbin.org</url><properties><project.build.sourceEncoding>UTF-8</project.build.sourceEncoding><maven.compiler.source>1.8</maven.compiler.source><maven.compiler.target>1.8</maven.compiler.target></properties><dependencies><dependency><groupId>junit</groupId><artifactId>junit</artifactId><version>4.11</version><scope>test</scope></dependency></dependencies><build><plugins><!-- 使用maven-assembly-plugin插件打包 --><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-assembly-plugin</artifactId><version>3.2.0</version><configuration><archive><manifest><!--主类 --><mainClass>org.hbin.App</mainClass></manifest></archive><descriptorRefs><!-- 可执行jar名称结尾--><descriptorRef>jar-with-dependencies</descriptorRef></descriptorRefs></configuration><executions><execution><id>make-assembly</id><phase>package</phase><goals><goal>single</goal></goals></execution></executions></plugin></plugins></build>
</project>

在这里插入图片描述

执行maven package

执行maven package命令,target目录将生成一个以jar-with-dependencies结尾的可直接执行jar。
运行命令:

> java -jar info-1.0-SNAPSHOT-jar-with-dependencies.jar

在这里插入图片描述

文档包和源码包

<!--生成doc jar包-->
<plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-javadoc-plugin</artifactId><executions><execution><id>attach-javadocs</id><goals><goal>jar</goal></goals><!-- 不让像@Param 这种后面没写值的东西 报错。--><configuration><additionalJOption>-Xdoclint:none</additionalJOption></configuration></execution></executions>
</plugin><!--生成源码jar包-->
<plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-source-plugin</artifactId><executions><execution><id>attach-sources</id><goals><goal>jar</goal></goals></execution></executions>
</plugin>

下次再有测试、运营或者其他部门的同事找你做工具,知道怎样快速制作可执行jar了吧?

http://www.yidumall.com/news/15815.html

相关文章:

  • 购买的网站怎么看网站空间大小发布软文平台
  • 做搜狗网站点击赚钱百度在线客服问答
  • 江西南昌网站建设招标微商引流的最快方法是什么
  • javasceip做网站产品推销方案
  • 国家税务总局网页北京seo优化多少钱
  • 聊城的网站制作公司线上线下一体化营销
  • 鸡泽网站建设免费推广的网站平台
  • 网站布局选择seo推广有哪些方式
  • 淘宝详情页设计成都网站seo诊断
  • 个人网站做百度竞价企业网站seo点击软件
  • 服务器的做网站空间专业培训机构
  • 镇江网页设计工作室优化方案丛书官网
  • 苏州微网站制作网络营销企业案例
  • 营销型网站建设开发价格上海百度推广开户
  • 做网站送域名和邮箱企业站seo
  • 微信公众号可以做网站嘛金昌网站seo
  • 昆明做网站建设公司seo就业
  • 潍坊网站建设公司电话百度提交入口网址是指在哪里
  • 做水果网站用什么域名怎么建立网站卖东西
  • c 网站开发构想网络推广工作内容
  • 如何让自己的网站被搜索引擎收录怎么推广一个平台
  • 乌海网站建设公司福州seo外包公司
  • 网站建设网页设计做网站seo的形式有哪些
  • 门户网站后台seo的中文名是什么
  • 上海公司注册代办机构武汉seo优化顾问
  • 福建龙岩天宫山风景区新手学seo
  • 电商网站 投诉国内新闻最近新闻今天
  • 成都 直播 网站建设网站优化排名软件网站
  • 可以查企业的网站aso优化
  • 电脑网站怎么创建到桌面上windows优化大师官网