Java Maven 程序集插件编译致命错误:目标版本 1.14 无效
Java Maven assembly plugin Fatal error compiling: invalid target release 1.14
我想使用 maven 程序集插件在 Intellij 中部署我的 javafx 项目,但每当我尝试这样做时,我得到
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project Battlesheet: Fatal error compiling: error: invalid target release: 1.14 -> [Help 1]
因此。我的 pom 如下:
<?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.Avalon</groupId>
<artifactId>Battlesheet</artifactId>
<version>1.0</version>
<name>Avalon Battlesheet</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.14</maven.compiler.source>
<maven.compiler.target>1.14</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-graphics</artifactId>
<version>15-ea+6</version>
<classifier>win</classifier>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-graphics</artifactId>
<version>15-ea+6</version>
<classifier>mac</classifier>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-graphics</artifactId>
<version>15-ea+6</version>
<classifier>linux</classifier>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>13</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
<version>15-ea+6</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.3.0</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.6</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.openjfx</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>0.0.4</version>
<configuration>
<mainClass>assembly.Launcher</mainClass>
<launcher>launch.sh</launcher>
<compress>2</compress>
<jlinkZipName>avalon-battlesheet</jlinkZipName>
<jlinkImageName>avalon-battlesheet</jlinkImageName>
<noManPages>true</noManPages>
<noHeaderFiles>true</noHeaderFiles>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>create-executable</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
<configuration>
<outputDirectory>${test.pack.dir}</outputDirectory>
<appendAssemblyId>false</appendAssemblyId>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>assembly.Launcher</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</build>
</project>
我知道已经有很多这样的问题了,但我至少通读了其中的大部分都无济于事。我的路径和 JAVA_HOME 都设置为我唯一的 JDK (AdoptOpenJDK 1.14) 我的项目结构应该尽可能设置为 1.14 现在我的知识失败了,为什么它仍然告诉我有一个无效的目标版本。任何帮助将不胜感激:)
您似乎正在尝试使用 Java 14 进行构建。不再使用前缀(又名 1.
),因此请尝试将 1.14
更改为 14
.
我想使用 maven 程序集插件在 Intellij 中部署我的 javafx 项目,但每当我尝试这样做时,我得到
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project Battlesheet: Fatal error compiling: error: invalid target release: 1.14 -> [Help 1]
因此。我的 pom 如下:
<?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.Avalon</groupId>
<artifactId>Battlesheet</artifactId>
<version>1.0</version>
<name>Avalon Battlesheet</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.14</maven.compiler.source>
<maven.compiler.target>1.14</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-graphics</artifactId>
<version>15-ea+6</version>
<classifier>win</classifier>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-graphics</artifactId>
<version>15-ea+6</version>
<classifier>mac</classifier>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-graphics</artifactId>
<version>15-ea+6</version>
<classifier>linux</classifier>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>13</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
<version>15-ea+6</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.3.0</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.6</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.openjfx</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>0.0.4</version>
<configuration>
<mainClass>assembly.Launcher</mainClass>
<launcher>launch.sh</launcher>
<compress>2</compress>
<jlinkZipName>avalon-battlesheet</jlinkZipName>
<jlinkImageName>avalon-battlesheet</jlinkImageName>
<noManPages>true</noManPages>
<noHeaderFiles>true</noHeaderFiles>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>create-executable</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
<configuration>
<outputDirectory>${test.pack.dir}</outputDirectory>
<appendAssemblyId>false</appendAssemblyId>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>assembly.Launcher</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
</plugins>
</build>
</project>
我知道已经有很多这样的问题了,但我至少通读了其中的大部分都无济于事。我的路径和 JAVA_HOME 都设置为我唯一的 JDK (AdoptOpenJDK 1.14) 我的项目结构应该尽可能设置为 1.14 现在我的知识失败了,为什么它仍然告诉我有一个无效的目标版本。任何帮助将不胜感激:)
您似乎正在尝试使用 Java 14 进行构建。不再使用前缀(又名 1.
),因此请尝试将 1.14
更改为 14
.