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

Where's JavaFX in recent Java 8u33 for the ARM ?

Thu Jan 22, 2015 10:52 am

Raspbian comes with Oracle's Java 8 for the ARM which has the nice JavaFX API using OpenGL-ES.
It's java version "1.8.0".

Also Oracle's update version "1.8.0_06" (8u6) from last year includes JavaFX. Its documentation is on Oracle's website, mentioning JavaFX. (I can't find the JDK binary 8u6 there anymore, just here).

However, with Oracle's most recent Java for the ARM update version "1.8.0_33" (8u33), I can't use the FX API anymore. My older FX programs as well as the JDK's FX demos won't run on the Pi anymore with this 8u33 version.

Is this a bug, or a feature ?


P.S. Yes, the PC's current Java JDK version is "1.8.0_31" (8u31) where all FX stuff runs fine.

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

Re: Where's JavaFX in recent Java 8u33 for the ARM ?

Thu Jan 22, 2015 11:15 am

It is feature.
See http://www.oracle.com/technetwork/java/ ... 06696.html
Section: 1 New and Changed Features
Soultion - alternative: OpenJFX, link: https://wiki.openjdk.java.net/display/OpenJFX/Main

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

Re: Where's JavaFX in recent Java 8u33 for the ARM ?

Thu Jan 22, 2015 11:32 am

Thanks for the link:
"Starting with JDK 8u33, JavaFX Embedded is removed from the ARM bundle and is not supported."

This is really bad news. Because the JavaFX API using OpenGL-ES was the main argument making Java attractive aka fast enough on the Pi, using it's GPU for graphics.

Do we know if the Pi Foundation will stay with Java 8u0 or 8u6 (hopefully) for future Raspbian relases, meaning including JavaFX ?
If it used the newer Java 8u33+ versions, older Java software using FX would be broken on the Pi...

What a mess.
Solution - alternative: OpenJFX, link: https://wiki.openjdk.java.net/display/OpenJFX/Main
Well, OpenJDK is a very nice reference implementation but speed-wise not an alternative. Oracle's Java is way faster in my experience, in particular on our little Pi.

Very sad news.

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

Re: Where's JavaFX in recent Java 8u33 for the ARM ?

Thu Jan 22, 2015 12:27 pm

No OpenJDK only OpenJFX.
JDK is still by Oracle (JDK 8u33 for ARM), but JavaFX to replace OpenJFX, see: https://wiki.openjdk.java.net/display/O ... Hard+Float

Bottom of the web page:
Testing a resulting build


When you run with this build you will need to tell Java to use your JavaFX instead of its built-in JavaFX. For example,


sudo /opt/jdk1.8.0/bin/java \
-Djava.ext.dirs=build/armv6hf-sdk/rt/lib/ext \
-jar BrickBreaker.jar

Note that setting java.ext.dirs overrides the location of the JRE extension directory, and so any other jars present in the extension directory of your JRE will not be seen.

As an alternative to java.ext.dirs, you can copy the build result on top of a copy of your JRE installation
JAVA_HOME=/opt/jdk1.8.0 # replace with your installation path
# remove some older JFX bits so they don't collide
rm -f $JAVA_HOME/jre/lib/ext/jfx*jar $JAVA_HOME/jre/lib/arm/libjavafx_font_t2k.so
# and then overlay the built bits
cp -r build/armv6hf-sdk/rt/lib $JAVA_HOME/jre/

Note that JavaFX on ARM assumes that it is running as root so that it may open the framebuffer and read directly from udev. It is certainly possible to set up system permissions so that running as root is not required.

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

Re: Where's JavaFX in recent Java 8u33 for the ARM ?

Thu Jan 22, 2015 12:35 pm

At least I hope that is the case, if someone from Oracle expressed...

diegobernardes
Posts: 7
Joined: Wed Feb 12, 2014 5:47 pm

Re: Where's JavaFX in recent Java 8u33 for the ARM ?

Thu Jan 22, 2015 2:40 pm

yea very bad news :/
i was planing to start a project in javafx to run on a raspberry.
now i need to know what gonna happen to javafx on raspberry :/

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

Re: Where's JavaFX in recent Java 8u33 for the ARM ?

Thu Jan 22, 2015 2:55 pm

ltorok, thanks for your postings.
So for experts it's possible to build OpenFX and add it to an Oracle JDK 8u33+ version on the Pi.
For the masses it won't be that simple.

So it depends on what the Pi Foundation will do with future Raspbian version and Oracle Java.
Who could we ask, concerning this?

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

Re: Where's JavaFX in recent Java 8u33 for the ARM ?

Thu Jan 22, 2015 2:56 pm

Diegobernardes, since the Raspberry Pi is a more fixed device compared to an always-changing PC/OS, you could just continue to use the current Oracle Java 8 which is shipped with the current Raspbian.

Also Oracle's newer Java 8u6 update is usable with JavaFX on the Pi.

In case you want to deploy your JavaFX application to Pi users or with a Pi, you could always bundle your needed Java JDK (or its smaller JRE) with your application. This is used often done on PCs, so that nothing changes and your Java app runs fine.

For an JRE example just unpack jdk-8u6-linux-arm-vfp-hflt.tar.gz and copy the jdk1.8.0_6 's jre-folder next to your JAR file, and then use a small shell-script to start your Java app from there, skipping the OS'es installed Java version.

I.e. like this:

Code: Select all

 - folder/jre/ ...
 - folder/yourapp.jar
 - folder/starter.sh
And starter.sh is:

Code: Select all

jre/bin/java -jar yourapp.jar

diegobernardes
Posts: 7
Joined: Wed Feb 12, 2014 5:47 pm

Re: Where's JavaFX in recent Java 8u33 for the ARM ?

Thu Jan 22, 2015 7:26 pm

Fidelius wrote:Diegobernardes, since the Raspberry Pi is a more fixed device compared to an always-changing PC/OS, you could just continue to use the current Oracle Java 8 which is shipped with the current Raspbian.

Also Oracle's newer Java 8u6 update is usable with JavaFX on the Pi.

In case you want to deploy your JavaFX application to Pi users or with a Pi, you could always bundle your needed Java JDK (or its smaller JRE) with your application. This is used often done on PCs, so that nothing changes and your Java app runs fine.

For an JRE example just unpack jdk-8u6-linux-arm-vfp-hflt.tar.gz and copy the jdk1.8.0_6 's jre-folder next to your JAR file, and then use a small shell-script to start your Java app from there, skipping the OS'es installed Java version.

I.e. like this:

Code: Select all

 - folder/jre/ ...
 - folder/yourapp.jar
 - folder/starter.sh
And starter.sh is:

Code: Select all

jre/bin/java -jar yourapp.jar
Indeed this can be done.
But in my opinion for commercial or new projects is better find a new alternative than using one that already require hacks and tricks to get runing, don't?
Well, i don't know, this new is very recent, let's wait and see what gonna happen..

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

Re: Where's JavaFX in recent Java 8u33 for the ARM ?

Thu Jan 22, 2015 7:47 pm

Normally a PI application (including the Java 8 and 8u6 application) which runs on the current Raspian, should continue to work also in the future. The PI Foundation normally is eager not to break things. (Gnome's Mahjongg from the PI repository is the exception, it broke some Raspbian versions ago.)

Also, on the PC it's common when you deploy a Java app, to include with your app a local Java Runtime Environment (JRE) which the actual app has been developed and tested for. This is safer since you never know what a customer's system has or hasn't installed.

I would do the same on the PI. It's not yet a hack.
Cross-compiling the OpenJFX and poking the result into the PI's JDK is a hack, however. :-)

So, I agree with you that the whole FX kicking in newer ARM Javas is a bad move and results in very unnecessary hassle. It undermines Java 8's FX API and the run-everywhere-philosophy, which Oracle also broke with Java 8's FX media codec API when run on the very wide-spread Ubuntu 14 LTS Linux.
Well, i don't know, this new is very recent, let's wait and see what gonna happen..
Yes, let's watch and pray.

dalibortopic
Posts: 1
Joined: Tue Jan 27, 2015 11:27 am

Re: Where's JavaFX in recent Java 8u33 for the ARM ?

Tue Jan 27, 2015 12:07 pm

Apologies for the terse release note regarding this change to the Oracle JDK for ARM and Oracle Java SE Embedded products. Clearly this change should have come with more context.

Starting with Oracle JDK for ARM 8u33 and Oracle Java SE Embedded 8u33, JavaFX Embedded, a port of JavaFX 8 which was only available on Linux/ARM platforms, is not supported, and has been removed from these downloads.

The complete source code for JavaFX Embedded has been contributed to the OpenJFX open source project in the OpenJDK community under the GPL v2 with Classpath exception license. JavaFX development has been done in the OpenJDK open source community for some time now, enabling JavaFX developers to contribute back their changes to the source code, and produce their own OpenJFX binaries for their target platforms under their own responsibility.

JavaFX continues to be provided as a fully supported part of the Oracle JDK 8 product on x86 platforms (Windows, Linux, Mac). Developers looking for alternatives to JavaFX Embedded could explore and contribute to the OpenJFX project in OpenJDK, or alternative UI frameworks like Swing or AWT.

Dalibor Topic
Principal Product Manager for OpenJDK @ Oracle

User avatar
chriswhocodes
Posts: 36
Joined: Mon May 21, 2012 11:26 am
Location: London, UK

Re: Where's JavaFX in recent Java 8u33 for the ARM ?

Fri Feb 06, 2015 9:30 am

Hi all,

The OpenJFX and Adopt OpenJDK communities are working on a build farm to produce ARM OpenJFX binaries.

We are also aiming to produce an integrated build of OpenJDK + OpenJFX for ARM v6 and v7 so that Pi and Pi2 users can continue to develop using Java and JavaFX.

Please see this mail thread for more details: http://mail.openjdk.java.net/pipermail/ ... 16601.html

Cheers,

Chris
@chriswhocodes
http://www.chrisnewland.com/raspberrypi

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

Re: Where's JavaFX in recent Java 8u33 for the ARM ?

Mon Feb 09, 2015 9:45 am

Good news, and thanks for it, Chriswhocodes.

Out of interest, and I asked the question already in the other Java on Pi2 thread:

Would a Java VM compiled against the Pi2 and its ARM7-Quadcore Cortex-A7 also bring some advantages compared to Raspbian's current Oracle Java8 which is optimised but compiled against ARM6/7 (if it means it uses ARM6 instructions only) ?

(I mean looking at a single core only. Obviously four cores help Java generally.)

mihol
Posts: 39
Joined: Wed May 09, 2012 6:55 pm
Location: Germany

Re: Where's JavaFX in recent Java 8u33 for the ARM ?

Mon Mar 09, 2015 9:20 am

I've tried to follow this conversation and understand the status of JavaFX on Pi but struggled a bit.
Is there any news on this topic?
Thanks Mike

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

Re: Where's JavaFX in recent Java 8u33 for the ARM ?

Mon Mar 09, 2015 3:22 pm

No news so far.

Current status is that the latest Raspbian version comes pre-installed with Oracle's Java 8 (internal version 1.8.0 i.e. 8u0) so still has got the JavaFX API included.

Just if you manually download from Oracle the most recent ARM's Java 8 (internal version 1.8.0_33 i.e. 8u33) it lacks the JavaFX API, however. This is totally lame, but well, I don't think it bothers many on the Pi yet, since most (Java) people will just use Raspbian's pre-installed Java (which still includes the JavaFX API).

Auf gut deutsch: ein paar hochrangige Hennenseggel am Werk beim Orakel von Delphi.

User avatar
chriswhocodes
Posts: 36
Joined: Mon May 21, 2012 11:26 am
Location: London, UK

Re: Where's JavaFX in recent Java 8u33 for the ARM ?

Sun Mar 15, 2015 5:15 pm

Hi all,

I've put together a server that produces nightly builds of OpenJFX for ARMv6 hard float.

http://108.61.191.178/

You can simply unzip these builds onto your jdk1.8.0_33 to get JavaFX support on the Pi for this and later ARM JDKs (instructions provided).

I'm working with the OpenJDK Adoption group to move this across to their CloudBees build farm but this should work for now.

Cheers,

Chris
@chriswhocodes
http://www.chrisnewland.com/raspberrypi

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

Re: Where's JavaFX in recent Java 8u33 for the ARM ?

Mon Mar 16, 2015 8:00 am

Thank you, Chris. Two questions please:

1) For non-sudo users on the Pi, in order to allow JavaFX in Raspbian's Oracle Java 8u0 or 8u6 to access the Pi's dev/vchiq and /dev/input devices, we just added the user to the Linux group "video" and "input", and everything worked fine.
However with your OpenJFX added to Oracle Java 8u33 (the one missing FX) there seems to be another group, which I don't know yet. With sudo users it works, but with non-sudo users I'm getting these errors:

Code: Select all

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

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

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

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

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

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

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

Udev: Failed to write to /sys/class/input/mouse0/uevent
      Check that you have permission to access input devices
2) The FX's media package containting for example the new FX sound system has always been missing in Oracle's ARM Java <= 8u6. Which was a pity, because the new javafx.scene.media.AudioClip for example works much more robust than the older javax.sound.sampled.Clip (for example on x86 Linux).
I hoped the OpenJFX would bring this missing media package also to our Pi, but unfortunately it's not there in your compilation. Is there any chance it could come with some future versions?

User avatar
chriswhocodes
Posts: 36
Joined: Mon May 21, 2012 11:26 am
Location: London, UK

Re: Where's JavaFX in recent Java 8u33 for the ARM ?

Mon Mar 16, 2015 11:20 am

Hi Fidelius,

Regarding (2) it does appear that AudioClip class file is present in jfxrt.jar

If you unzip openjfx-8-sdk-overlay-linux-armv6hf.zip then inside jre/lib/ext/jfxrt.jar you will find AudioClip.class

Code: Select all

chris@vultr:/tmp$ unzip openjfx-8-sdk-overlay-linux-armv6hf.zip 
Archive:  openjfx-8-sdk-overlay-linux-armv6hf.zip
   creating: lib/
  inflating: lib/javafx-mx.jar       
  inflating: lib/packager.jar        
  inflating: lib/ant-javafx.jar      
   creating: man/
   creating: man/ja_JP.UTF-8/
   creating: man/ja_JP.UTF-8/man1/
  inflating: man/ja_JP.UTF-8/man1/javafxpackager.1  
  inflating: man/ja_JP.UTF-8/man1/javapackager.1  
   creating: man/man1/
  inflating: man/man1/javafxpackager.1  
  inflating: man/man1/javapackager.1  
   creating: jre/
   creating: jre/lib/
  inflating: jre/lib/javafx.properties  
  inflating: jre/lib/jfxswt.jar      
  inflating: jre/lib/javafx.platform.properties  
   creating: jre/lib/ext/
  inflating: jre/lib/ext/jfxrt.jar   
   creating: jre/lib/arm/
  inflating: jre/lib/arm/libprism_sw.so  
  inflating: jre/lib/arm/libdecora_sse.so  
  inflating: jre/lib/arm/libprism_es2_eglfb.so  
  inflating: jre/lib/arm/libjavafx_font_pango.so  
  inflating: jre/lib/arm/libprism_common.so  
  inflating: jre/lib/arm/libfxplugins.so  
  inflating: jre/lib/arm/libglass_monocle.so  
  inflating: jre/lib/arm/libjavafx_font_freetype.so  
  inflating: jre/lib/arm/libgstreamer-lite.so  
  inflating: jre/lib/arm/libjfxwebkit.so  
  inflating: jre/lib/arm/libjavafx_font.so  
  inflating: jre/lib/arm/libglass.so  
  inflating: jre/lib/arm/libprism_es2_monocle.so  
  inflating: jre/lib/arm/libjfxmedia.so  
  inflating: jre/lib/arm/libglass_monocle_x11.so  
  inflating: jre/lib/arm/libjavafx_iio.so  
chris@vultr:/tmp$ grep AudioClip * -R
Binary file jre/lib/ext/jfxrt.jar matches
Perhaps there are some .so binaries that are required as well. Oracle did appear to commit to releasing all of the ARM code as open source in their JavaFX on ARM announcement so hopefully it will appear.

Kind regards,

Chris
@chriswhocodes
http://www.chrisnewland.com/raspberrypi

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

Re: Where's JavaFX in recent Java 8u33 for the ARM ?

Mon Mar 16, 2015 3:50 pm

Hallo Chris, and thanks for your answer. Well, the class is there indeed, however it unfortunately doesn't seem to work (for me). The following function

Code: Select all

[javafx.application.]  Platform.isSupported( ConditionalFeature.MEDIA )
returns false (as it always did, also with Oracle Java 8u0). So for testing purposes I ignored the flag and tried to still create a:

Code: Select all

[javafx.scene.media.]  AudioClip
... which stops with the following error on my Pi2 :

Code: Select all

java.lang.UnsatisfiedLinkError:
/opt/jdk8u33/jre/lib/arm/libjfxmedia.so: 
wrong ELF class: ELFCLASS64 (Possible cause: architecture word width mismatch)

User avatar
chriswhocodes
Posts: 36
Joined: Mon May 21, 2012 11:26 am
Location: London, UK

Re: Where's JavaFX in recent Java 8u33 for the ARM ?

Mon Mar 16, 2015 10:49 pm

Hi Fidelius,

You're right, some of the .so binaries in the zip are x86-64.

This could be a problem with the OpenJFX gradle build script or a side-effect of some of the JavaFX libs not yet available for ARM.

I've posted on openjfx-dev mailing list: https://www.mail-archive.com/openjfx-de ... 08864.html

Cheers,

Chris
@chriswhocodes
http://www.chrisnewland.com/raspberrypi

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

Re: Where's JavaFX in recent Java 8u33 for the ARM ?

Wed Mar 18, 2015 8:29 am

Thanks Chris, for your efforts and postings on the OpenJFX mailing list.

It's a sad situation Oracle has put us in. Judging from the Oracle guys' postings on the mailing list, it means that Java 8u0 and 8u6 always only partly supported FX on ARM machines (see missing media package), and Oracle officially drops FX entirely on the ARM machines starting with Java 8u33.

So a complete Java8 including FX runs on desktop machines only -- but not completely on Ubuntu Linux 14 LTS, where the JavaFX's media package can't do video and audio codecs. And well, many use their Pi2 on the desktop, too. So the complete Java8 including FX does basically run on Windos only. But what do we need it for, then?

The removing of FX in ARM Java is one strange decision when we look at the constantly decreasing numbers of sold desktop PCs and the explosion of numbers of ARM devices including the Pi (~5 millions) which blurs the lines between desktop and "embedded" devices completely. Is the Pi2 not yet available in overseas?

So, practically we could stick with Java 8u0 or 8u6 on the Pi and have at least the bigger parts of JavaFX, until some fat bugs or security holes force us to upgrade. Or wait until some smart people like you and others have all the means to compile a full OpenJFX to the Arm machines.

Confusing. I really liked FX when it was bundled with Java8. But now I say: Bad times for Java friends.
Last edited by Fidelius on Wed Mar 18, 2015 9:07 am, edited 1 time in total.

User avatar
chriswhocodes
Posts: 36
Joined: Mon May 21, 2012 11:26 am
Location: London, UK

Re: Where's JavaFX in recent Java 8u33 for the ARM ?

Wed Mar 18, 2015 8:57 am

I guess you could try and create your own "Frankenstein" ARM JDK using 8u33 + OpenJFX nightly + media binaries from older Oracle JDKs ?

I'll let you know if I can make any progress getting the media stuff to compile for armv6hf.

Cheers,

Chris
@chriswhocodes
http://www.chrisnewland.com/raspberrypi

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

Re: Where's JavaFX in recent Java 8u33 for the ARM ?

Thu Jun 18, 2015 11:59 am

chriswhocodes wrote:I guess you could try and create your own "Frankenstein" ARM JDK using 8u33 + OpenJFX nightly + media binaries from older Oracle JDKs ?

I'll let you know if I can make any progress getting the media stuff to compile for armv6hf.

Cheers,

Chris
Due to how the Java binary license is written may prevent use of a "Frankenstein" ARM JDK using 8u33 + OpenJFX nightly + media binaries from older Oracle JDKs
OpenJFX adds classes under the com.sun namespace something paragraph F of the binary license of the Oracle JDK prevents you to do.

http://www.oracle.com/technetwork/java/ ... index.html
"F. JAVA TECHNOLOGY RESTRICTIONS. You may not create, modify, or change the behavior of, or authorize your licensees to create, modify, or change the behavior of, classes, interfaces, or subpackages that are in any way identified as "java", "javax", "sun", “oracle” or similar convention as specified by Oracle in any naming convention designation."

Thus as i see it, you can only use OpenJFX in combination with OpenJDK where the GPLv2+classpath exception license allows you to add classes under the "java", "javax", "sun", “oracle” namespaces without the above mentioned restriction.

If someone fork OpenJFX and patches it to stop using the com.sun.* "java", "javax", "sun", “oracle” namespaces then it will license compatible with Oracles binary JDK release.
Xerxes Rånby @xranby I once had two, then I gave one away. Now both are in use every day!
twitter.com/xranby

onebeartoe
Posts: 6
Joined: Fri May 03, 2013 7:18 pm

Re: Where's JavaFX in recent Java 8u33 for the ARM ?

Fri Nov 13, 2015 5:34 pm

Doh! When upgraded to ejdk1.8.0_65, I started seeing this issue.

A JavaFX app I am working on would run just fine with the built-in JRE; 1.8.0-b132.

But then I needed javafx.scene.control.ButtonType which came out in JavaFX 8u40.

Hence the need to upgrade. But using ejdk1.8.0_65 or ejdk1.8.0_51 would give this message:

"Error: Could not find or load main class"

So using chriswhocodes's overly made things work again! Albeit, I have to run the app with 'sudo' now :shock:

onebeartoe
Posts: 6
Joined: Fri May 03, 2013 7:18 pm

Re: Where's JavaFX in recent Java 8u33 for the ARM ?

Fri Nov 13, 2015 5:36 pm

Thank you, chriswhocodes, very much for putting up these overlays!

It pretty much saved me from dumping my JavaFX app for Raspberry Pi

Return to “Java”