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.Solution - alternative: OpenJFX, link: https://wiki.openjdk.java.net/display/OpenJFX/Main
Code: Select all
- folder/jre/ ...
- folder/yourapp.jar
- folder/starter.sh
Code: Select all
jre/bin/java -jar yourapp.jar
Indeed this can be done.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:And starter.sh is:Code: Select all
- folder/jre/ ... - folder/yourapp.jar - folder/starter.sh
Code: Select all
jre/bin/java -jar yourapp.jar
Yes, let's watch and pray.Well, i don't know, this new is very recent, let's wait and see what gonna happen..
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
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
Code: Select all
[javafx.application.] Platform.isSupported( ConditionalFeature.MEDIA )
Code: Select all
[javafx.scene.media.] AudioClip
Code: Select all
java.lang.UnsatisfiedLinkError:
/opt/jdk8u33/jre/lib/arm/libjfxmedia.so:
wrong ELF class: ELFCLASS64 (Possible cause: architecture word width mismatch)
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 JDKschriswhocodes 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