0% found this document useful (0 votes)
2 views17 pages

JavaFX Installation

This document provides a step-by-step guide for installing JavaFX using the Eclipse IDE, including the installation of Eclipse itself and the e(fx)clipse plug-in. It outlines the necessary actions to set up a JavaFX project, configure preferences, and run a basic JavaFX application. The instructions are tailored for both Windows and Linux users, detailing the required VM arguments for successful execution.

Uploaded by

Mrs.Kavitha G
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views17 pages

JavaFX Installation

This document provides a step-by-step guide for installing JavaFX using the Eclipse IDE, including the installation of Eclipse itself and the e(fx)clipse plug-in. It outlines the necessary actions to set up a JavaFX project, configure preferences, and run a basic JavaFX application. The instructions are tailored for both Windows and Linux users, detailing the required VM arguments for successful execution.

Uploaded by

Mrs.Kavitha G
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

JavaFX - Installation Using Eclipse

Eclipse is an integrated development environment (IDE) used in Java


programming. It contains a workspace and an extensible plug-in system
in order to customize the environment. You can also use JavaFX with
Eclipse.

This chapter explains the steps to create a JavaFX application in Eclipse


IDE. We will be using the latest versions of both JavaFX SDK and
Eclipse.

Installing JavaFX in Eclipse


A plug-in named e(fx)clipse is available in Eclipse IDE to support
JavaFX. You can use the following steps to set JavaFX in Eclipse. First
of all, make sure that you have Eclipse in your system. If not, download
and install Eclipse in your system.

To install Eclipse IDE, follow the given steps below −

Step 1 − Visit the [Link] website.


 Click the download button for the file named eclipse-inst-jre-
[Link] to be downloaded.
 Run the file downloaded for the eclipse installation to begin.

Step 2 − Select the highlighted option in the image below for the
installation to begin.
Step 3 − Click on the install button to install the chosen Eclipse IDE
version.
Step 4 − This step starts the installation of Eclipse IDE and it may take a
while.

Step 5 − Lastly, launch the application to see the welcome page.


Installing JavaFX Plug-In
Once Eclipse is installed, follow the steps given below to
install e(fx)clipse plug-in in your system.
Step 1 − Open the Help menu in Eclipse and select Eclipse
Marketplace option as shown below.
Upon clicking, it will display the new window containing all the plug-
ins, as shown in the following screenshot.

Step 2 − In the Find text box, search for e(fx)clipse plug-in using the 'fx'
keyword.
Step 3 − Once retrieved, click the Install button to install JavaFX plug-
in in Eclipse.
Step 4 − In the next window, you will see a license agreement for
JavaFX that you have to agree to. Select "I agree" and click "finish".
Step 5 − Once the plug-in is installed, the eclipse will need to be
restarted. So, click the restart option as shown below.
Step 6 − You will have to set the preferences by pointing to the
installation directory of JavaFX. For that, in the "Window" menu, click
on "Preferences" as shown below.
Step 7 − Click on "JavaFX" option and point to the "lib" directory of
JavaFX SDK as shown in the screenshot. If you have "Scenebuilder"
installed, you can point to the installation directory of Scenebuilder as
well, like shown.
Step 8 − Now that JavaFX preferences are set, you are ready to create a
new JavaFX project. Go to "File -> New -> Other".
Step 9 − Then, you will get a window where you can see a list of
wizards provided by Eclipse to create a project. Expand
the JavaFX wizard, select JavaFX Project and click the Next button as
shown in the following screenshot.
Step 10 − On clicking Next, a New Project Wizard opens. Here, you can
type the required project name and click Finish.
Step 11 − On clicking Finish, an application is created with the given
name (FirstJavaFXProjectt). A module_info.java file is automatically
created as well, which needs to be deleted in order to avoid errors while
running our project.
Step 12 − In the sub-package named application, a program with the
name [Link] is created as shown below. Before executing this file,
we must add VM arguments. For that, go to the "Run" symbol and click
"Run configurations" as shown in the screenshot below.
Step 13 − In the "Arguments" tab, add the following VM arguments −

In Windows
--module-path "\path\to\javafx-sdk-20\lib" --add-modules
[Link],[Link]
In Linux
--module-path /path/to/javafx-sdk-20/lib --add-modules
[Link],[Link]

Look at the screenshot below −

Once added, click "Apply" and "Close".

Step 14 − Now, upon executing the [Link] file, a new window pops
up containing the given label.

You might also like