JAVAFX and Raspberry PI B

Francisco Javier Godino jgodino at yahoo.com
Fri Sep 12 14:36:01 UTC 2014


Hello:

I installed Oracle Java SE 8 JDK for Linux ARMV6/7 on Raspberry PI using Oracle indications.

http://www.oracle.com/webfolder/technetwork/tutorials/obe/java/RaspberryPiFX/raspberryfx.html#overview


I created an application to run on it and I have an issue loading FXML.

The code is:

private Initializable replaceSceneContent(String fxml) throws Exception {
        
        Locale locale = new Locale("es", "ES");
        ResourceBundle rb = ResourceBundle.getBundle("internacionalizacion.lang",locale) ;

        FXMLLoader loader = new FXMLLoader();
        InputStream in = Main.class.getResourceAsStream(fxml);
        loader.setBuilderFactory(new JavaFXBuilderFactory());
        loader.setLocation(Main.class.getResource(fxml));
        loader.setResources(rb);
        
        AnchorPane page;
        try {
            page = (AnchorPane) loader.load(in);
        } finally {
            in.close();
        } 
        Scene scene = new Scene(page, stage.getWidth(),stage.getHeight()-50);
        stage.setScene(scene);
        return (Initializable) loader.getController();
    }

java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:483)
        at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:367)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:483)
        at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:300)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:483)
        at sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:767)
Caused by: java.lang.RuntimeException: Exception in Application start method
        at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:894)
        at com.sun.javafx.application.LauncherImpl.access$000(LauncherImpl.java:56)
        at com.sun.javafx.application.LauncherImpl$1.run(LauncherImpl.java:158)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NoClassDefFoundError: javafx/fxml/FXMLLoader
        at startup.Main.replaceSceneContent(Main.java:273)
        at startup.Main.gotoPantallaPrincipal(Main.java:209)
        at startup.Main.start(Main.java:180)
        at com.sun.javafx.application.LauncherImpl$8.run(LauncherImpl.java:837)
        at com.sun.javafx.application.PlatformImpl$7.run(PlatformImpl.java:335)
        at com.sun.javafx.application.PlatformImpl$6$1.run(PlatformImpl.java:301)
        at com.sun.javafx.application.PlatformImpl$6$1.run(PlatformImpl.java:298)
        at java.security.AccessController.doPrivileged(Native Method)
        at com.sun.javafx.application.PlatformImpl$6.run(PlatformImpl.java:298)
        at com.sun.glass.ui.lens.LensApplication$RunnableEvent.dispatch(LensApplication.java:182)
        at com.sun.glass.ui.lens.LensApplication._runLoop(LensApplication.java:860)
        at com.sun.glass.ui.lens.LensApplication.access$1800(LensApplication.java:58)
        at com.sun.glass.ui.lens.LensApplication$4.run(LensApplication.java:917)
        ... 1 more


Do I need install anything else?

Thanks

Francisco


More information about the openjfx-dev mailing list