Adam9850
Posts: 5
Joined: Sun Nov 08, 2015 6:17 pm

Java FX

Sun Nov 08, 2015 6:59 pm

I have Ubuntu Mate in my Raspberry Pi. I downloaded JDK 8 from http://www.oracle.com/technetwork/java/ ... 33151.html.
I tried

Code: Select all

java -jar app.jar
But i got message "Error: JavaFX runtime components are missing, and are required to run this application".
how to run a JavaFX applications ?


Adam9850
Posts: 5
Joined: Sun Nov 08, 2015 6:17 pm

Re: Java FX

Tue Nov 10, 2015 3:56 pm

I did everything that was in http://stackoverflow.com/questions/2837 ... k8-for-arm, but application didn't start and I got a message

Code: Select all

* failed to open vchiq device

User avatar
xranby
Posts: 539
Joined: Sat Mar 03, 2012 10:02 pm
Contact: Website

Re: Java FX

Wed Nov 11, 2015 7:27 am

Adam9850 wrote:I did everything that was in http://stackoverflow.com/questions/2837 ... k8-for-arm, but application didn't start and I got a message

Code: Select all

* failed to open vchiq device
This "* failed to open vchiq device" message is reported by the GPU driver when your Ubuntu user do not have read and write access to the /dev/vchiq file, a requirement to use the Broadcom OpenGL driver and camera interface.

The solution is to make your Ubuntu user have write access to the /dev/vchiq file.

I give you three solutions A,B and C... pick one!

A) a quick solution, run your application as the root (super user that can read and write to all files including the /dev/vchiq device file) using the sudo command
sudo java -jar app.jar

B) a temporary solution (until reboot): make the /dev/vchiq file read and writable by all users on your Ubuntu system.
sudo chmod a+rw /dev/vchiq

then start your application normally
java -jar app.jar

C) configure your ubuntu system to let all users in the video group have read and write access and then add your user to the video group
echo 'SUBSYSTEM=="vchiq",GROUP="video",MODE="0660"' > /etc/udev/rules.d/10-vchiq-permissions.rules
usermod -a -G video your_username

log out then log in login again and from now on you shall be able to start your application normally
java -jar app.jar
Xerxes Rånby @xranby I once had two, then I gave one away. Now both are in use every day!
twitter.com/xranby

User avatar
Fidelius
Posts: 459
Joined: Wed Jan 01, 2014 8:40 pm
Location: Germany

Re: Java FX

Wed Nov 11, 2015 12:22 pm

ltorok wrote:or download JavaFX from Gluon
Well, thanks for this hint! I've awaited such a port for quite some time and am very pleased to see that the JavaFX Scenebuilder team Gluon does provide such a decent FX port, so we can again use a recent Java version!

So I downloaded Oracle's ARM Java 8u65 and copied Gluon's FX folder to Java's jre/lib folder, as
documented under Gluon's 2.1.4 Embedded.

And indeed the JavaFX applications now run on my Ubuntu 15.10 for the Pi with this patched new Java 8u65, but they fail to read the keyboard / mouse , i.e. no key presses possible, and bring several times this error message while continuing to run, so FX graphic is working :

Code: Select all

Udev: Failed to write to /sys/class/input/mouse0/uevent
      Check that you have permission to access input devices

java.io.FileNotFoundException: /sys/class/input/mouse0/uevent (Keine Berechtigung)

    at java.io.FileOutputStream.open0(Native Method)
    at java.io.FileOutputStream.open(FileOutputStream.java:270)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:101)
    at com.sun.glass.ui.monocle.SysFS.write(SysFS.java:121)
    at com.sun.glass.ui.monocle.SysFS.triggerUdevNotification(SysFS.java:108)
    at com.sun.glass.ui.monocle.LinuxInputDeviceRegistry.<init>(LinuxInputDeviceRegistry.java:74)
    at com.sun.glass.ui.monocle.LinuxPlatform.createInputDeviceRegistry(LinuxPlatform.java:37)
    at com.sun.glass.ui.monocle.NativePlatform.getInputDeviceRegistry(NativePlatform.java:67)
    at com.sun.glass.ui.monocle.MonocleApplication.<init>(MonocleApplication.java:71)
    at com.sun.glass.ui.monocle.MonoclePlatformFactory.createApplication(MonoclePlatformFactory.java:42)
    at com.sun.glass.ui.Application.run(Application.java:146)
    at com.sun.javafx.tk.quantum.QuantumToolkit.startup(QuantumToolkit.java:257)
    at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:211)
    at com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:675)
    at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:337)
    at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:328)
    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:497)
    at sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:767)
Of course I've got the two groups "video" and "input", like Xranby mentions, since my older Java 8u06 (which still included FX officially) is happy then and runs all FX applications including input devices correctly.

But not so on Gluon's FX port. What could be missing?


P.S. When Java is run with sudo rights, it works, but that's not good.


User avatar
Fidelius
Posts: 459
Joined: Wed Jan 01, 2014 8:40 pm
Location: Germany

Re: Java FX

Thu Nov 12, 2015 10:59 am

Yes, I know this thread because back then I wrote down the answers to my "not to forget list". :-)

Unfortunately the main user here on Ubuntu 15.10 for the Pi is already in the video and input group , but it doesn't help the Oracle Java 8u65 with included Gluon FX port folders.

The original Oracle Java 8u6 which still includes FX, works fine however. Just not the Gluon port concerning input, for Java 8u65. Output (videoc) works fine with Gluon, but no input. With sudo everything works, but that's no help.

Do others have the same problem, or did I miss something?

ltorok
Posts: 14
Joined: Wed Aug 06, 2014 4:27 am

Re: Java FX

Thu Nov 12, 2015 12:51 pm

For Raspbian is all ok, possible specific for Ubuntu or try Gluon forum (JavaFXPorts) : http://gluonhq.com/forums/
Sometimes time ago I am crosscompile JavaFX for older Raspberry Pi B, compile on Ubuntu (PC), run on Raspbian, then set correct group and all ok, but on Ubuntu on Raspberry I don't know.

Adam9850
Posts: 5
Joined: Sun Nov 08, 2015 6:17 pm

Re: Java FX

Sat Nov 14, 2015 9:40 pm

SDK from the (https:///bitbucket.org/javafxports/arm/downloads) didn't work. When I solved the "failed to open vchiq device", the application jammed. Then I tried http://gluonhq.com/gluon-javafx-embedde ... -released/ and with using -Djava.ext.dirs application started, but when SDK wasn't in the downloaded files the application jammed. Next, I followed the http://docs.gluonhq.com/javafxports/#anchor-1, but the application jammed. Why application jammed when SDK wasn't in downloaded files ? And if it is important I have Raspberry Pi 2.

Adam9850
Posts: 5
Joined: Sun Nov 08, 2015 6:17 pm

Re: Java FX

Sun Nov 15, 2015 2:37 pm

When i started javafx application via Putty , application didn't start and i got message.

Code: Select all

assertion failure:/build/buildd/raspberrypi-vc-1.20150502.d280099/interface/vmcs_host/vc_vchi_dispmanx.c:87:lock_obtain():dispmanx_client.initialised
What does it mean ?

User avatar
Fidelius
Posts: 459
Joined: Wed Jan 01, 2014 8:40 pm
Location: Germany

Re: Java FX

Mon Nov 16, 2015 10:50 am

Concerning the problem with Gluon's JavaFX port for ARM devices where the input devices can only be used when run with sudo, it seems to be a bug. Here's the exact same question on the Gluon forum, unfortunately with no answer so far:
http://gluonhq.com/forums/topic/mouse-i ... dded-port/

Are there any Pi users out there who actually use Oracle's current ARM Java with this FX port from Gluon (which you can simply copy into the JDK folder) ?

Return to “Java”