Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

package javafx.scene.control not found in Fedora 29

I'm trying to build this code

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.stage.Stage;

public class ButtonExperiment extends Application  {

    @Override
    public void start(Stage primaryStage) throws Exception {
        primaryStage.setTitle("HBox Experiment 1");

        Button button = new Button("My Button");

        Scene scene = new Scene(button, 200, 100);
        primaryStage.setScene(scene);
        primaryStage.show();

    }

    public static void main(String[] args) {
        Application.launch(args);
    }
}

but I get this error:

package javafx.scene.control does not exist

I'm using openjava 8

[medeo@medeo-E540 ~]$ java -version
openjdk version "1.8.0_181"
OpenJDK Runtime Environment (build 1.8.0_181-b15)
OpenJDK 64-Bit Server VM (build 25.181-b15, mixed mode)

and I think I've installed all the necessari open JavaFX (aka openjfx):

dnf list java*
Last metadata expiration check: 1 day, 8:31:13 ago on Sun 04 Nov 2018 10:38:02 CET.
Installed Packages
java-1.8.0-openjdk.x86_64                                   1:1.8.0.181.b15-6.fc29     @updates
java-1.8.0-openjdk-devel.x86_64                             1:1.8.0.181.b15-6.fc29     @updates
java-1.8.0-openjdk-headless.x86_64                          1:1.8.0.181.b15-6.fc29     @updates
java-1.8.0-openjdk-openjfx.x86_64                           1:1.8.0.181.b15-6.fc29     @updates
java-1.8.0-openjdk-openjfx-devel.x86_64                     1:1.8.0.181.b15-6.fc29     @updates
java-9-openjdk-headless.x86_64                              1:9.0.4.11-6.fc28          @fedora 
java-gnome.x86_64                                           4.1.3-18.fc29              @fedora 
javapackages-filesystem.noarch                              5.3.0-1.fc29               @fedora 
javapackages-tools.noarch                                   5.3.0-1.fc29               @fedora