In this video, I wanna show you
how to configure JavaFX to get it working on JDK 11.
Now we're gonna be doing that for the IntelliJ IDEA IDE,
but if you're running another IDE like Eclipse or NetBeans,
you should be able to get it working based
on what I show you with this video.
Now in this video we'll also cover up
the Windows, Mac and Linux platforms,
because the configuration is very similar.
So anyway, let's make a start.
(upbeat electric music)
Java applications can have graphical user interfaces
that contain buttons, lists, check boxes, menus,
toolbars, and many other controls
that allow users to interact with Rich Client applications.
JavaFX is a set of APIs that we use
to build user interfaces in Java.
It's essentially a set of Java packages
and it's the successor to Swing,
which was Java's UI-toolkit for many years.
So you can use the JavaFX to develop the UI
for desktop applications,
internet applications, and mobile devices.
With the release of JDK 11,
JavaFX is no longer part of the Core JDK.
So that means we need to download the JavaFX
jar. Files and configure them separately,
to get them working.
So in this video, I'm gonna go through the steps
to set up the JavaFX package to work with the JDK 11.
Alright, so the process we need to follow,
to get JavaFX working with the JDK 11,
involves firstly doing a download,
so we're going to download the file that we need.
We wanna go to our browser
and the website we wanna go to is
Gluonhq.com/products/javafx/
and you can see here that it talks about,
the JavaFX runtime being available
as a platform-specific SDK.
So we need the JavaFX SDK, for your operating system
to be downloaded and installed.
And just a note here,
that it is important to download the correct version.
For example, if you downloaded the
Windows version of the JavaFX Windows SDK,
you'd be able to instal it and set it up on
a Mac, but you'll find that it won't work.
So make sure you do download the right version.
I'm on a Windows machine, so I'm gonna download
the windows version of the SDK for JavaFX.
Good news is it's quite a small download.
You can see it's under 38mb, we're gonna save that
and give my computer a moment to run the security scan,
then we'll continue with the installation.
Alright, so that's finished downloading.
So what I'm gonna do is, just go to open the folder.
And if you've any difficulties like I have,
just go to explorer and just go to the folder.
In my case, the Downloads folder.
So I'm gonna go there now.
And you can see this, openjfx_11,
that's the file that I'm gonna take a copy of.
Now we need to put that somewhere
in a good spot because we need to put it in
that spot and then it will need to be referred to
anytime you use JavaFX in a project.
So in other words, you don't wanna put it
into a temporary location or put it
on your desktop or somewhere that you accidentally delete.
So in my case what I'm gonna do is,
I'm gonna put it in the Documents folder,
in a sub-folder called lib,
and I'm gonna paste it into there.
Then I'm going to extract the zip file.
Alright so that's finished now,
then we're going to go into that unzipped folder.
Then I'm going to cut the sub-folder, which is JavaFX-sdk-11
Then I'm going to go back to my
lib folder and paste it in there.
So in other words we've got a sub-folder JavaFX-SDK-11,
in my libs sub-folder.
I'm gonna delete those other two files there
because we no longer need them.
Alright, so that's that file there,
and what we need to do then is swing back to IntelliJ.
So I'll just minimise the browser for now
and we need to configure a Global Library,
so that we can automatically use JavaFX
in any projects we create.
So to define a Global Library, click on Configure,
click on Project Defaults, and click on Project Structure.
Next, we wanna come over here to Global Libraries.
Then we wanna click on plus, wanna select Java,
now we need to navigate to the folder
where we have just created that JavaFX folder,
from the unzipped folder that we downloaded.
So in my case it's going to be in my users folder,
going to go to my Documents folder, there's the lib folder,
in my case it's the JavaFX folder.
I need to go into sub-folder, of lib, then JavaFX sdk,
then the sub-folder lib, then need to select
all the jar. files that are in that folder,
select the mark sign, and click on OK.
And the other thing I suggest you do is
just change the name there to something more meaningful.
I'm gonna call it, Java FX 11.
Just so for me, I know that that's the JavaFX
library for the JDK 11.
So we're gonna save that, and at this point
we'd be able to find the Global Library for JDK 11.
Alright so thanks for watching
if you've got questions, leave a comment.
If you're ready for the next programming specific video,
click on the link up here in the top
left hand corner of your screen.
To look at non-coding programming related questions,
click on the link down at the bottom
left hand corner of your screen.
Feel free to subscribe, by clicking on the link up here
and I'll see you in another video.