Installing Java and JavaFX
These instructions were originally written
by Dr. Taylor for the introductory
programming courses for 2022-23. We are following these directions for the
Fall, 2024 sections of SWE 2410.
Install Java 17 JDK
- Download Windows/x64
.msi
build from here (be sure to click on the Java 17 tab to ensure you are getting the correct version)
- Open the
.msi
file to install JDK17
Install JavaFX 19
- Apparently JavaFX 17 is no longer available for download.
- Download x64 JavaFX 19 Windows SDK from here and unzip the file
- Select Windows for the Operating System
- Select x64 for the Architecture
- Select SDK for the Type
- Copy the
javafx-sdk-19
folder from the .zip
file to C:\Program Files\Java\
OPTIONAL: Install Scene Builder 19
Many students will find they do not need Scene Builder for SWE 2410, but
here are the directions if you are looking for them:
Set the Project SDK
- Go to File -> New Projects Setup -> Structure
- Select Project under Project Settings on the left side
- Set SDK to 17 (if available); otherwise:
- Click Add SDK
- Select JDK and browse to
C:\Program Files\Java\jdk-17.0.5
- Under Project language level select SDK default (17 - Sealed types, always-strict floating-point semantics)
- Click OK
Add JavaFX to Global Library
- Go to File -> New Projects Setup -> Structure
- Select Global Libraries under Platform Settings on the left side
- Click the + (plus symbol) in the upper left of the second column
- Select Java from the menu
- Browse to
C:\Program Files\Java\javafx-sdk-19\lib
(adjust to match version)
- Click OK twice
Set Run Configuration Template for Application
- Go to File -> New Projects Setup -> Run Configuration Templates...
- Select Application
- Click Modify options (or type Alt+M) and ensure Add VM options is checked
- Paste the following in VM options:
--module-path "C:\Program Files\Java\javafx-sdk-19\lib" --add-modules=javafx.controls,javafx.fxml
- Here too, ensure that the version number matches what you downloaded
- Click OK
New IntelliJ Project
All of the steps above must be implemented once, but you'll need to do the following for each new IntelliJ project.
- Create a Java (not JavaFX) project, if you create a JavaFX project, you will need to set the run configuration (as described above).
Add the JavaFX SDK library
- Go to File -> Project Structure... (CTRL+ALT+SHIFT+S)
- Select Modules
- Open the Dependencies tab and click +
- Select Library...
- Within your JavaFX installation, select the lib folder.
- Click Add Selected and then OK