stoli
Posts: 3
Joined: Wed Feb 12, 2014 7:08 pm

Running javafx using WebView webEngine on RPi fails

Wed Feb 12, 2014 7:35 pm

Hi,

This is my first post in this forum, so hello to everyone. Normally I'm able to solve all my problems on simply searching, but this time I'm not successful.

I've written a sever-client based webbrowser. The idea is to enter an URL on the server, and this webpage will be opened fullscreen on a client. I've tested it successful on a windows pc. Oh, I forget, the client need to be able to run jscript/HTML5. That was the reason why I choose javafx with webView and webEngine.

As client host I want to use the RPi. I read a lot of tutorials and stackoverflow:
https://wiki.openjdk.java.net/display/O ... spberry+Pi
http://stackoverflow.com/questions/1780 ... mand-error

on 2nd link I found this comand line command:

Code: Select all

sudo /opt/jdk1.8.0/bin/java -Djavafx.platform=eglfb -cp /opt/jdk1.8.0/jre/lib/jfxrt.jar:/home/pi/javafx-samples-8.0.0-ea/StopWatch.jar stopwatch.MainScreen
It sound well to me, but I got all time errors. Then I found out that on the latest dev build for ARM https://jdk8.java.net/download.html the jfxrt.jar is missing.

Searching around the whole wide web, I found this post, from danielblaukopf (If you read this post, maybe you have an answer) http://www.raspberrypi.org/phpBB3/viewt ... 4&p=496006.
Regarding his reply the jfxrt.jar is splitted in two separated jars: "jdk1.8.0/jre/lib/ext/jfxrt-controls.jar" and "jdk1.8.0/jre/lib/ext/jfxrt-graphics.jar".

My question is now, how to deal with it?
How can I call those files to launch my program?
Is the webVew webEngine not possible with JavaFX on ARM? If yes, Is there any other possibility to match my requirements?
Have I missed something?

Sorry for so many questions, but it is really anoying that I'm not able to solve this problem.

Many thanks,
Stoli

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

Re: Running javafx using WebView webEngine on RPi fails

Thu Feb 13, 2014 5:10 pm

When you use Java8 on the Pi, Javafx is already on the classpath, as it is also with the the "big" Java 8 plattforms (Linux, Windos, etc).

Anyway, no need to include some Javafx packages manually, a simple "jdk8/bin/java -jar YourJavaFxApplication.jar" will do, see the Javafx8 demos.

However, unfortunately the entire (javafx.scene.) media and web package is missing in Java8 for the ARM (and other smaller devices, it seems). So, no web classes, no media-player classes, and no audioclip classes, etc. It's mentioned here on Java.net:
Daniel Blaukopf wrote:JDK 8 EA builds for the Raspberry Pi include full support for hardware accelerated graphics, with everything from the base, graphics, controls and FXML modules. Media and Web modules are not included.
This is sad, and makes the distribution of Java programs more difficult than before Java 8, because until Java 8 you knew that on any J2SE plattform all the packages where there. Not so anymore with Java 8...

This is one of the missing packages: http://docs.oracle.com/javafx/2/api/jav ... frame.html
Last edited by Fidelius on Fri Feb 14, 2014 9:00 am, edited 1 time in total.

stoli
Posts: 3
Joined: Wed Feb 12, 2014 7:08 pm

Re: Running javafx using WebView webEngine on RPi fails

Thu Feb 13, 2014 7:06 pm

Hi,

Thank you for the answer, it helps me a lot, because now I know it is not possible and I can stop to try.

Is there an other possiblity to get a java embedded webbrowser running on the RPi ? As I remember from the past, Swing is to basic, and not HTML5 ready. I become insane with this limitations. Why Oracle has stripped down the Java8 to a creepy "lite" version?


Cheers Stoli

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

Re: Running javafx using WebView webEngine on RPi fails

Fri Feb 14, 2014 9:06 am

stoli wrote:Is there an other possiblity to get a java embedded webbrowser running on the RPi ?
Well, unfortunately I'm not familiar with Web browser programming. AFAIK the Opensource Netbeans includes some (Java) web browser plug-in. I haven't used it, but saw it in the plug-ins list. If it's already there in Netbeans 7 (using Jdk 7), I don't know anymore, since I'm currently using Netbeans 8 beta using Jdk 8.
As I remember from the past, Swing is to basic, and not HTML5 ready. I become insane with this limitations.
Although Swing is robust and nice, it indeed never had HTML in mind, let alone HTML5. :-) So doing HTML(5) with Swing is very, very hard.

But any Opensource Java-based Webkit thing using the robust Java2D, if there's one, could do what you need.
Maybe you could als take a look at the Java source-code of the JavaFx web module in OpenJDK8. There's sources in the "big" Jdk's, here for example: Jdk8/javafx-src.zip/javafx/scene/web/
Why Oracle has stripped down the Java8 to a creepy "lite" version?
That's a mystery to me, too.
For the first time it breaks the deployment of J2SE JARs. We're not talking about the "profiles" coming with Java8, but the "normal" J2SE. Imagine my surprise when I some JavaFX tests which run on the standard Java 8 JRE on Linux and Windows, threw a "class not found" exception on the Pi when the JAR wanted to use the JavaFX8 audioclip class. (The old and unhandy javax.sound.sampled package do work on the Pi, but the newer ones would be much simpler to use.)

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

Re: Running javafx using WebView webEngine on RPi fails

Fri Feb 14, 2014 12:02 pm

Fidelius wrote:
stoli wrote:Is there an other possiblity to get a java embedded webbrowser running on the RPi ?
As I remember from the past, Swing is to basic, and not HTML5 ready. I become insane with this limitations.
Although Swing is robust and nice, it indeed never had HTML in mind, let alone HTML5. :-) So doing HTML(5) with Swing is very, very hard.
I want to add an example how you can do HTML(5) with Swing by using the OpenJDK caciocavallo-web project.
http://rkennke.wordpress.com/2012/12/12 ... web-howto/
cacio-web can render the swing application gui into the html5 canvas, the swing application is thus running on the server and no plugins are needed on the client web-browser.
cacio-web also allows you to use any web-browser (mobile and desktop) as an event input source for a swing application running on the pi.
i have managed to use cacio-web on the Pi, it work as a proof of concept,
using it as a input source work really fast.
Xerxes Rånby @xranby I once had two, then I gave one away. Now both are in use every day!
twitter.com/xranby

henrik
Posts: 65
Joined: Tue Dec 18, 2012 4:24 pm

Re: Running javafx using WebView webEngine on RPi fails

Thu Feb 27, 2014 4:20 pm

Fidelius wrote:
stoli wrote:
Why Oracle has stripped down the Java8 to a creepy "lite" version?
That's a mystery to me, too.
For the first time it breaks the deployment of J2SE JARs. We're not talking about the "profiles" coming with Java8, but the "normal" J2SE. Imagine my surprise when I some JavaFX tests which run on the standard Java 8 JRE on Linux and Windows, threw a "class not found" exception on the Pi when the JAR wanted to use the JavaFX8 audioclip class. (The old and unhandy javax.sound.sampled package do work on the Pi, but the newer ones would be much simpler to use.)
Profiles aside, we have not removed anything from JDK 8 that would cause it to be labeled a "lite" version. There are some components that are not part of the Java SE 8 specification but rather optional add-ons, such as JavaDB and (yes) JavaFX. Until a component is part of the spec - which is a longer process - changes to it are to be expected.

For JavaFX specifically, this is still very much under development. We started on desktops (Windows/Mac/Linux, x86) and are adding support for Linux/ARM now. The Linux/ARM work we do is primarily intended for smaller embedded devices, not fully functional desktops, and our development priorities are set accordingly - media/web not done at this point for instance. However, not that JavaFX is completely open source through the OpenJFX project so if you have the interested, skill and time on your hands you can fill this gap yourself!

Henrik, Oracle Java team

sebi
Posts: 13
Joined: Thu May 01, 2014 10:55 am

Re: Running javafx using WebView webEngine on RPi fails

Thu May 01, 2014 11:08 am

@Stoli: I have the same Problem, thank you for your post.
Do you find another component or a approach to solve your Problem for view a Web Page embedded into a Java Application?

Sebi

Nelyo
Posts: 1
Joined: Mon May 19, 2014 1:16 pm

Re: Running javafx using WebView webEngine on RPi fails

Mon May 19, 2014 1:20 pm

Daniel Blaukopf wrote:
JDK 8 EA builds for the Raspberry Pi include full support for hardware accelerated graphics, with everything from the base, graphics, controls and FXML modules. Media and Web modules are not included.
That is why my projekt fails. 200 man-hour for nothing!!
Is there hope that will included next time?

stoli
Posts: 3
Joined: Wed Feb 12, 2014 7:08 pm

Re: Running javafx using WebView webEngine on RPi fails

Tue May 20, 2014 5:23 pm

Sorry for the delayed response.

We are using a (dirty) workaround. We're launching chromium via command line and show the website full screen.

That's not the best way to do this, but with the limitation of Javafx for ARM, it's the only way to get it working. Of course you can only do this, if you don't want to embed Web content in your application.

I hope that there will come a more satisfying way to work with, but at the moment we don't find an other solution.

Return to “Java”