我已经完成了一个Maven项目,我想将其导出到可运行的exe(或jar文件)。
将其导出到可运行的.jar文件后,该文件将无法打开。
我做了什么->右键单击项目->刷新->导出->可运行的Jar文件->需要包...
与.exe文件相同,我使用launch4j并导出到.exe文件,它也不会运行。
我做了什么->右键单击项目->刷新->导出->可运行的Jar文件->需要提取...JRE分钟:1.7.0(我正在使用jdk-13.0.1)
有人对此有任何提示吗?谢谢!
更新:
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.test</groupId>
<artifactId>testProject</artifactId>
<version>0.0.1-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>11.0.2</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
<version>11.0.2</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.15</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>4.1.1</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<release>11</release>
</configuration>
</plugin>
<plugin>
<groupId>org.openjfx</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>0.0.1</version>
<configuration>
<mainClass>com.test.testProject.App</mainClass>
</configuration>
</plugin>
</plugins>
</build>
</project>
右键单击项目->运行方式-> Maven构建它将询问目标:清洁包装
您将在目标中找到罐子
如果Maven构建旨在用于其他用途,请使用运行配置并根据上述目标创建新的运行
(所有这些,都被认为是一个Maven项目,否则,您可能想在之前对其进行美化,包括launch4j配置以便生成exe文件)