Travis使用JavaFx支持构建OpenJDK10
因为几天后travis不再支持jdk选项oraclejdk10。所以我试着转到openjdk10。问题是,我需要JavaFX支持,并且我会在各种尝试中收到各种错误消息,以使其正常工作: 尝试1:Travis使用JavaFx支持构建OpenJDK10,java,javafx,travis-ci,java-10,Java,Javafx,Travis Ci,Java 10,因为几天后travis不再支持jdk选项oraclejdk10。所以我试着转到openjdk10。问题是,我需要JavaFX支持,并且我会在各种尝试中收到各种错误消息,以使其正常工作: 尝试1: language: java install: true script: "cd Aggregation; mvn test -B" sudo: false jdk: - openjdk10 notifications: email: recipients: -
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.
E: Unable to locate package libopenjfx-java
The command "sudo apt-get build-dep libopenjfx-java" 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 openjfx
The command "sudo apt install -y openjfx" failed and exited with 100 during.
E: Unable to locate package libopenjfx-java
The command "sudo apt-get build-dep libopenjfx-java" failed and exited with 100 during.
由于OpenJDK中不包含JavaFX,因此需要对OpenJFX进行适当的设置才能使其正常工作,而且还应该升级到OpenJDK 11,因为Java10是EOL(生命终止) 查阅官方文件: OpenJDK 11:
正如Jan S.所建议的那样,使用Maven依赖项而不是试图使用Travis构建JavaFX很好。 将以下内容添加到Maven依赖项部分:
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>11</version>
</dependency>
org.openjfx
javafx控件
11
使用OpenJDK 8构建Teavis
language: java
dist: bionic
jdk:
- openjdk8
before_install:
- sudo apt-get update -q
- sudo apt install openjfx=8u161-b12-1ubuntu2 libopenjfx-java=8u161-b12-1ubuntu2 libopenjfx-jni=8u161-b12-1ubuntu2
- chmod +x deploy.sh
after_success:
- ./deploy.sh
“EOL”代表?我以为它的意思是“线的尽头”。这些缩略语令人困惑。这正是我想要做的。我如何下载openjfx的二进制文件并将其放在travis可以找到的地方,或者如何使用travis下载并编译源代码?手工编译openjfx不是问题。您必须使用Gradle或Maven构建一个编译任务,然后才能使用ci执行该任务。