我正在尝试使用 Git bash 将我的 discord bot 项目上传到 Heroku 我的项目是 java 10,我使用的是 Maven,但出现此错误:
remote: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project bot_discord: Fatal error compiling: invalid flag: --release -> [Help 1]
remote: [ERROR]
remote: [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
remote: [ERROR] Re-run Maven using the -X switch to enable full debug logging.
remote: [ERROR]
remote: [ERROR] For more information about the errors and possible solutions, please read the …
Run Code Online (Sandbox Code Playgroud) 尝试将Maven从Java 9迁移到Java 10会在pom.xml中产生错误,这 maven-compiler-plugin
不起作用:
Java 9配置(效果非常好):
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<source>1.9</source>
<target>1.9</target>
<release>9</release>
<executable>javac9</executable>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
Run Code Online (Sandbox Code Playgroud)
基于此 stackoverflow问题的Java 10配置(失败):
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<source>10</source>
<target>10</target>
<release>10</release>
<executable>javac10</executable>
<encoding>UTF-8</encoding>
</configuration>
<dependencies>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm</artifactId>
<version>6.1.1</version> <!-- Use newer version of ASM -->
</dependency>
</dependencies>
</plugin>
Run Code Online (Sandbox Code Playgroud)
错误mvn clean package
:
[INFO] --- maven-compiler-plugin:3.7.0:compile (default-compile) @ XR3Player ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 164 source files to D:\GitHub\XR3Player\target\classes
[INFO] ------------------------------------------------------------------------
[INFO] …
Run Code Online (Sandbox Code Playgroud) 我正在迁移到OpenJDK 11和OpenJFX 11.我已经从源代码成功构建了两个,并且根据OpenJFX wiki使用--with-import-modules = [path_to_modular_sdk] arg来构建JDK.一切顺利,直到我尝试在Apache Netbeans 9中构建一个简单的"Hello World"测试项目; 此时我收到以下错误:" 在活动JDK中找不到JavaFX部署库 ".试图搜索这方面的信息,但找不到任何相关的信息.如果有人能够阐明造成这种情况的原因,我将非常感激.谢谢你的帮助.帕特里克.
如何在 pom 文件中配置 OpenJDK 11。
<properties>
<maven.compiler.plugin.version>3.8.0</maven.compiler.plugin.version>
<maven.compiler.target>11</maven.compiler.target>
<maven.compiler.source>11</maven.compiler.source>
</properties>
Run Code Online (Sandbox Code Playgroud) 您好,我已从 java 8 升级到 java 11,无论如何我都会收到此错误。我使用的是 Intellij 和 windows 10。我已更改为 11:1)在项目结构 -> 项目中:
3)我的编译器模块目标字节码版本在设置->构建、执行、部署-> Java编译器中也设置为11。
我什至将用户变量中的 JAVA_HOME 和系统变量中的 JAVA_HOME 两个环境变量分别更改为 jdk-11.0.8。
当我运行 java -version 和 javac -version 时,都显示我安装了版本 11。当我尝试运行 mvn clean 包时,它总是因此错误而失败
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (default-compile) on project abc: Fatal error compiling: invalid
target release: 11 -> [Help 1]
Run Code Online (Sandbox Code Playgroud)
请帮我修复错误,任何帮助将不胜感激!
LE这是项目 pom 的一部分
<plugin>
<inherited>true</inherited>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<optimize>true</optimize>
<encoding>UTF-8</encoding>
<showWarnings>true</showWarnings>
<showDeprecation>true</showDeprecation>
<compilerArguments>
<parameters/>
</compilerArguments>
</configuration>
Run Code Online (Sandbox Code Playgroud)
我也添加<release>11</release> <!--or <release>10</release>-->
了它,但同样的问题仍然存在。
我有一个 JavaFx 项目,其中Maven install
不断给我错误:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project gui: Compilation failure: Compilation failure:
[ERROR] /C:/Users/digit/eclipse-workspace/gsn-notator/gui/src/main/java/gui/AppController.java:[21,19] package javafx.fxml does not exist
[ERROR] /C:/Users/digit/eclipse-workspace/gsn-notator/gui/src/main/java/gui/AppController.java:[29,17] cannot find symbol
[ERROR] symbol: class FXMLLoader
[ERROR] location: class gui.AppController
[ERROR] /C:/Users/digit/eclipse-workspace/gsn-notator/gui/src/main/java/gui/AppController.java:[29,45] cannot find symbol
[ERROR] symbol: class FXMLLoader
[ERROR] location: class gui.AppController
Run Code Online (Sandbox Code Playgroud)
我究竟做错了什么?我如何说服 Maven/Eclipse/Java/Whatever 找到FXMLLoader
?
项目结构有两个模块,gui
和logic
,与本教程中的项目结构。我的整体项目 pom 是:
<modules>
<module>logic</module>
<module>gui</module>
</modules>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<configuration>
<source>11</source>
<target>11</target> …
Run Code Online (Sandbox Code Playgroud) 它正在使用 java 8,但我更改为 java 10(我关注了这篇文章:无法使用 Maven 编译简单的 Java 10 项目)
我收到此错误:
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:47 min
[INFO] Finished at: 2018-09-26T20:15:28Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (default-compile) on project importparcoursup: Fatal error compiling: invalid flag: --release -> [Help 1]
[ERROR]
Run Code Online (Sandbox Code Playgroud)
gitlab-ci.yml
image: maven:latest
stages:
- build
build:
stage: build
script:
- mvn install:install-file -Dfile=lib/ojdbc8.jar -DgroupId=com.oracle -DartifactId=ojdbc8 -Dversion=12.2.0.1 -Dpackaging=jar compile
Run Code Online (Sandbox Code Playgroud)
pom.xml
<?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>nc.unc</groupId>
<artifactId>importparcoursup</artifactId> …
Run Code Online (Sandbox Code Playgroud)