How to set up a DataFX application
A lot of people start using DataFX in small projects without a build file and by doing so they sometimes use old builds. Because of that I will give you some hints how to setup a project that is using DataFX.
Every stable DataFX build can be found at Maven Central. If you are new to Maven or Maven Central just open this link. On the page you will find all artifacts of DataFX. If you for example want to use DataFX core you can download the jar, sources and javadoc here.
Each DataFX artifact is defined by the group-id, artifact-id and version. The group-id is always “io.datafx” and the artifact-id depends on the DataFX-Module. If you for example want to create an application that is suing the DataFX Flow you need the datafx-flow module and all it’s dependencies. At the moment the last stable version is 8.0.
If you want to download the DataFX jars by hand and add them to your application you need to download all dependencies of the module, too. Thankfully DataFX doesn’t have much dependencies. Here is an overview:
Once you have downloaded the last version of DataFX and added the jars to the class path of your application you can start coding.
Normally you won’t download the dependencies of your application manually. Build tools like Maven or Gradle can do this job for you. By using one of the tools you only need to define the dependencies in your build file and the build tool will automatically download all needed jars. In addition the tools support transitive dependencies. This allows you to avoid needing to discover and specify the libraries that your own dependencies require, and including them automatically. If you Maven as build tool and you only want to add the DataFX Flow API to your application you only need to add one dependency:
<dependency> <groupId>io.datafx</groupId> <artifactId>flow</artifactId> <version>8.0</version> </dependency>
Once you added DataFX as dependency to your application you can using it as described in the tutorials.
Hendrik Ebbers is the founder of Open Elements. He is a Java champion, a member of JSR expert groups and a JavaOne rockstar. Hendrik is a member of the Eclipse JakartaEE working group (WG) and the Eclipse Adoptium WG. In addition, Hendrik Ebbers is a member of the Board of Directors of the Eclipse Foundation.