Installing and Setting Up JavaFX in Eclipse IDE
Installing and Setting Up JavaFX in Eclipse IDE
Installing and Setting Up JavaFX in Eclipse IDE
2. Scroll down to Latest Release, select the appropriate download based on your OS.
For 64-bit
Windows
For 32-bit
Windows
For macOS
3. Once it finishes downloading, open the zipped folder and extract it to the location of your choice. For
demonstration, I have unzipped it to C:\OpenJFX\openjfx-16_windows-x64_bin-sdk\
Vision Paudel
Installing and setting up JavaFX in Eclipse IDE 3
4. In Eclipse, right click your project, go to Build Path > Configure Build Path…
Vision Paudel
Installing and setting up JavaFX in Eclipse IDE 4
10. Go to the folder where you extracted the openjfx. Then, go into the lib folder. Select all the
executable jar files and click Open
Vision Paudel
Installing and setting up JavaFX in Eclipse IDE 7
14. Delete the template code. Copy the code below and paste it into your MyFirstGUIProgram.java file.
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
public class MyFirstGUIProgram extends Application {
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage primaryStage) throws Exception {
StackPane pane = new StackPane();
pane.getChildren().add(new Label("Hello World!"));
Scene scene = new Scene(pane, 200, 50);
primaryStage.setTitle("First JavaFX Demo!");
primaryStage.setScene(scene);
primaryStage.show();
}
}
Way 2 :
For Way 1, Click Here
1. Go to
https://drive.google.com/drive/folders/1WQnDgH3IMLGEYMqiNGlBWIY-qE6CZSr6?usp=sharing
2. Download appropriate JDK based on your OS. Run it, click Yes when prompted for Admin Access.
Click Next
Vision Paudel
Installing and setting up JavaFX in Eclipse IDE 12
4. Click Next
Vision Paudel
Installing and setting up JavaFX in Eclipse IDE 13
5. Click Close
Vision Paudel
Installing and setting up JavaFX in Eclipse IDE 14
6. In Eclipse, Create a Java Project. Then Click Use default JRE ‘jre’ and workspace compiler preferences.
Then click on Configure JREs…
Vision Paudel
Installing and setting up JavaFX in Eclipse IDE 15
7. Click on Add…
9. Click on Directory…
10. Go to your java installation folder. If you didn’t change it, it would be C:\Program
Files\Java\jre1.8.0_291\ Then Select Folder
Vision Paudel
Installing and setting up JavaFX in Eclipse IDE 17
12. Deselect the old jre and click on the new jre (jre1.8.0.291) making it default. Click Apply and Close
Vision Paudel
Installing and setting up JavaFX in Eclipse IDE 18
18. Delete the template code. Copy the code below and paste it into your MyFirstGUIProgram.java file.
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
public class MyFirstGUIProgram extends Application {
public static void main(String[] args) {
launch(args);
}
@Override
public void start(Stage primaryStage) throws Exception {
StackPane pane = new StackPane();
pane.getChildren().add(new Label("Hello World!"));
Scene scene = new Scene(pane, 200, 50);
primaryStage.setTitle("First JavaFX Demo!");
primaryStage.setScene(scene);
primaryStage.show();
}
}