Bitbucket's pipelines with Java Maven project and JFX

Hi everyone, my team and I have a maven project using jdk1.8 (not open jdk) and javaFX for our UI. It's working well and there still a lot of work to do and we'd like to use the pipelines from Bitbucket to make continuous integration on the go.

I tried to use a simple .yml file :

image: maven:3.3.9-jdk-8
- step:
- maven
script: # Modify the commands below to build your repository.
- mvn -B verify # -B batch mode makes Maven less verbose

But there is my problem, We are developping with IntelliJ and jdk1.8 where javaFX is standard and automatically included in the project. But the pipelines tries to use openjdk1.8, and can't find the javaFX classes (especially the jfxrt.jar file).

If I do nothing and try as it is, the Maven error is :

[ERROR] /opt/atlassian/pipelines/agent/build/src/main/java/JFX/[3,26] package javafx.application does not exist
[ERROR] /opt/atlassian/pipelines/agent/build/src/main/java/JFX/[4,19] package javafx.fxml does not exist
[ERROR] /opt/atlassian/pipelines/agent/build/src/main/java/JFX/[5,20] package javafx.scene does not exist
[ERROR] /opt/atlassian/pipelines/agent/build/src/main/java/JFX/[6,20] package javafx.scene does not exist
[ERROR] /opt/atlassian/pipelines/agent/build/src/main/java/JFX/[7,20] package javafx.stage does not exist

 I tried to include the jfxrt.jar file to maven to my pom.xml as a system dependency like that :


But then Maven warns me he does not find the jfxrt.jar file :

[WARNING] 'dependencies.dependency.systemPath' for javafx:jfxrt:jar refers to a non-existing file /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext/jfxrt.jar @ line 34, column 25

Mainly because he is using openjdk and not jdk.


I also tried to put the jfxrt.jar file inside the repository and make a dependency to it, it works but Maven warns me it's not proper to do it like that :


and the warning :

[WARNING] 'dependencies.dependency.systemPath' for should not point at files within the project directory, ${basedir}/dependency/jfxrt.jar will be unresolvable by dependent projects @ line 34, column 25[WARNING] 
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.

My question is how to either force Maven to use JDK and not OpenJDK (in Bitbucket !), or how to make a nice dependency to javaFX so Maven can verify our project everytime we push and not warn us.


Thank you all for your future responses.

2 answers

I have the same problem. Any solutions?

The problem is that the docker image doesn't support JavaFX.

There are two solutions:

1) Find an image with openjfx on  This is preferred, since it takes fewer build minutes than the next solution.

2) Install openjfx before building.  At the beginning of your script block, add:

- apt update
- apt install openjfx -y

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 06, 2018 in Bitbucket

Upgrade Best Practices

Hello! My name is Mark Askew and I am a Premier Support Engineer for products Bitbucket Server/Data Center, Fisheye & Crucible. Today, I want to bring the discussion that Jennifer, Matt, and ...

658 views 5 9
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you