使用exe4j把jar打包成exe文件
一、使用assembly将Java项目打成Jar包
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.5.5</version>
<configuration>
<archive>
<manifest>
<mainClass>你的Main方法所在全路径</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
</plugin>
点击Maven点击插件进行打包
二、将打包后的jar包打包成exe可执行文件
1、去官网下载exe4j :https://www.ej-technologies.com/download/exe4j/files
2、ProjectType
3、Application info
4、Executable info
5、Java invocation
6、选择合适的JRE
7、Splash screen
直接点 next
8、Messages
9、 消息
直接点 next
10 Compile executable 10. 编译可执行文件
直接点 next
11. Finished
就已经打包好可执行文件了