几天后,travis 不再支持 jdk 选项 oraclejdk10。所以我尝试移动到 openjdk10。问题是,我需要 JavaFX 支持,并且在尝试使其正常工作时收到各种错误消息:
尝试 1:
language: java
install: true
script: "cd Aggregation; mvn test -B"
sudo: false
jdk:
- openjdk10
notifications:
email:
recipients:
- junktogo@web.de
on_success: change
on_failure: always
特拉维斯错误: javafx.application 等多个包不存在
尝试 2(安装 openjfx 包): 我添加了以下部分:
before_install:
- sudo apt install -y openjfx
特拉维斯错误:
E: Unable to locate package openjfx
The command "sudo apt install -y openjfx" failed and exited with 100 during.
即使添加 sudo apt update
,这个问题仍然存在。
尝试 3:
before_install:
- sudo apt-get build-dep libopenjfx-java
- sudo apt-get --compile source libopenjfx-java
特拉维斯错误:
E: Unable to locate package libopenjfx-java
The command "sudo apt-get build-dep libopenjfx-java" failed and exited with 100 during.
最佳答案
正如 Jan S. 建议的那样,使用 Maven 依赖项包括 JavaFX 而不是尝试使用 Travis 构建它就可以了。 将如下内容添加到您的 Maven 依赖项部分:
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>11</version>
</dependency>
关于java - Travis 构建支持 JavaFx 的 OpenJDK10,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52947655/