Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Travis build OpenJDK10 with JavaFx support

Since a few days travis does not support the jdk option oraclejdk10 anymore. So I tried to move to openjdk10. The problem is, that I need JavaFX support, and I get various error messages for various tries to get it working:

Try 1:

language: java

install: true

script: "cd Aggregation; mvn test -B"

sudo: false
jdk:
    - openjdk10

notifications:
  email:
    recipients:
      - [email protected]
    on_success: change
on_failure: always

Travis error: Multiple packages like javafx.application do not exist

Try 2 (Install the openjfx package): I added the following section:

before_install:
    - sudo apt install -y openjfx

Travis error:

E: Unable to locate package openjfx
The command "sudo apt install -y openjfx" failed and exited with 100 during.

This problem remains even if adding sudo apt update.

Try 3:

before_install:
    - sudo apt-get build-dep libopenjfx-java
    - sudo apt-get --compile source libopenjfx-java

Travis error:

E: Unable to locate package libopenjfx-java
The command "sudo apt-get build-dep libopenjfx-java" failed and exited with 100 during.
like image 505
TrackerSB Avatar asked Jan 22 '26 02:01

TrackerSB


1 Answers

As Jan S. suggested including JavaFX using a Maven dependency instead of trying to build it using Travis works just fine. Add something like the following to your Maven dependencies section:

<dependency>
    <groupId>org.openjfx</groupId>
    <artifactId>javafx-controls</artifactId>
    <version>11</version>
</dependency>
like image 125
TrackerSB Avatar answered Jan 23 '26 15:01

TrackerSB



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!