JavaSE Embedded 8 + JavaFX for Raspberry PI (hard float)


52 posts   Page 2 of 3   1, 2, 3
by henrik » Sun Dec 23, 2012 8:36 pm
kermitas wrote:
mouseclicker wrote:Kermitas, I installed the JVM and on latest Raspbian Wheezy and run Tomcat 7. Installed in a couple of minutes and worked like a charm :) System is under 100% CPU for minutes then, but then response times are good. Cool stuff!


Great! Thank you:)
I think JDK8 for ARM hard FP is very good direction!


And this is only an EA build... We are also working on a hardfloat build of JDK 7. The ARM port itself is closed source and will remain so for now, but there are some great places where the community can help us make Java for the RPi even better:
- general OpenJDK work, class libraries, tools, multi-language support, etc
- OpenJFX, all of JavaFX will be open source in this project including the ARM port. Help us improve the graphics pipeline, build controls, improve the Swing/SWT and HTML5 integration, add raw JOGL support, add game controller support, make the audio pipeline work better on RPi etc.
- Help us move some of the Java ME APIs to Java SE and port to RPi, including the Device Access API and Location (http://www.oracle.com/technetwork/java/ ... index.html). If there is any interest in these or other more hardware-centric APIs we will open source our efforts on java.net.

We use GPL+Classpath Exception on all OpenJDK projects. OpenJDK derivates get a free TCK license under the OCTLA program (that's why you have a OpenJDK build for the RPi, folks!).

Head over to java.net and help out, look for the OpenJDK and OpenJFX projects!

Henrik
Posts: 65
Joined: Tue Dec 18, 2012 4:24 pm
by noxo » Mon Dec 24, 2012 10:59 am
Tried myself running some stuff @720p using JavaFX & Java8 early access on RPI.

http://www.youtube.com/watch?v=Z_p-Yh38cIo

Nice to see so much development has been done on Java FX + ARM support :P
Posts: 15
Joined: Tue Jul 31, 2012 6:52 pm
Location: Vantaa, Finland
by jamesrth » Fri Dec 28, 2012 1:35 am
Problem

Hi guys. I've got Wheezy hard-float running on my Model B. 128 Mb video memory split set. Latest jdk1.8.0 ARM Linux preview loaded and java PATH set.

Here's the catch, I'm only able to VNC or ssh -Y pi@xxx.xxx.x.x ; lxsession in XQuartz on my Mac. I have no monitor.

Every time I try to run a JavaFX jar using the stock instructions from Oracle (and this forum) I get the following error upon JVM start up:

ES2Pipeline: OpenGL ES 2.0 embedded device detected
glGetError 0x500


I have a hunch this is due to the fact that I'm remotely accessing the LXDE session and it's not on a physical monitor attached to the RPi.

Has anybody else seen this error / found a way around it? The JVM just hangs and I have to kill the process manually.

Any help you can give me would be greatly appreciated!

Cheers,
James
Posts: 2
Joined: Thu Dec 27, 2012 7:44 pm
by noxo » Fri Dec 28, 2012 12:25 pm
jamesrth wrote:Problem

Here's the catch, I'm only able to VNC or ssh -Y pi@xxx.xxx.x.x ; lxsession in XQuartz on my Mac. I have no monitor.

I have a hunch this is due to the fact that I'm remotely accessing the LXDE session and it's not on a physical monitor attached to the RPi.


My guess is that, this is due to way JavaFX render stuff directly to framebuffer (and bypassing the xserver), and vnc/remote-x-connection doesn't support it. I'm not sure if there's another version of vncserver that would support this.

I'm also getting the same GL error at startup, but my app runs fine. Is it possible that your application is running fine, but you are just not seeing anything because of remote display not working :)
Posts: 15
Joined: Tue Jul 31, 2012 6:52 pm
Location: Vantaa, Finland
by ota-kun » Fri Dec 28, 2012 7:43 pm
Thanks Oracle. I've been waiting for this!

I've been using my Raspberry Pi as a Jenkins/Hudson CI server for my private project. Before I used the default java-7-openjdk package.

With Oracle embedded the performance changed dramatically.

The response time of the website was now okay. No long waiting time.

Changes of build time:
Old with Openjdk7 after dozens of builds: 3min 49 (1st run can took up to 5-6 min)

After tomcat restart with Oracle embedded:
1st run: 3min48
2nd run: 1min47
3rd run: 1min37

I had no errors installing or starting my tomcat 7 server.
Posts: 36
Joined: Tue Jul 17, 2012 8:38 am
by jamesrth » Sat Dec 29, 2012 8:57 pm
Thanks for this. I've been banging my head against a wall for days trying to figure out why I can't VNC the JavaFX stuff! Need a monitor to do that for now.

Well, I'm only really interested in using it as a headless device, so I'll be patient and wait. I really appreciate the development in JavaFX and for the Pi. What great technology projects they both are!

Please let the community know how the hard-float builds are getting along and when the X11 stuff over VNC will work!

Cheers!

rbair wrote:Hey,

http://jdk8.java.net/fxarmpreview/javaf ... eview.html
http://javafx.steveonjava.com/javafx-on ... asy-steps/

You can now go grab JavaSE Embedded 8 developer preview (including JIT, hotspot) for Raspberry PI, hard float, and JavaFX. I did a build and install this morning. The main thing to be aware of for the JavaFX stuff is that right now we have only released the EGLFB version of the graphics stack, which means it will take over control of the frame buffer, which basically means that it is useful for Kiosk / media center types of scenarios but not for X11 usage (our X11 port to PI doesn't yet have hardware acceleration and isn't ready for release).

Kick the tires an let us know what you think!
Posts: 2
Joined: Thu Dec 27, 2012 7:44 pm
by plugwash » Sun Dec 30, 2012 2:14 pm
seems jdk8.java.net is no longer responding...

edit: seems to be back up.
Forum Moderator
Forum Moderator
Posts: 2325
Joined: Wed Dec 28, 2011 11:45 pm
by danielblaukopf » Mon Dec 31, 2012 7:44 pm
noxo wrote:My guess is that, this is due to way JavaFX render stuff directly to framebuffer (and bypassing the xserver), and vnc/remote-x-connection doesn't support it. I'm not sure if there's another version of vncserver that would support this.


This is correct. It is unlikely that any existing VNC server will be able to provide a view of the Pi's framebuffer. Some devices provide OpenGL through EGL directly on /dev/fb0, but the Pi uses the dispmanx (http://elinux.org/RPi_VideoCore_APIs) and a VNC server would have to use that API or something lower-level to get at the pixels.

Daniel
Posts: 42
Joined: Thu Dec 20, 2012 8:03 pm
by benoit_t » Tue Jan 01, 2013 7:18 pm
Hello, I'm new to Raspberry and also Linux world. In real life, I am a Java developper (also c/c++). That is why I have installed the jdk8 preview with success but when trying to start JavaFX sample, I am getting the following error:

ES2Pipeline: OpenGL ES 2.0 embedded device detected
glGetError 0x500

Then, my mouse freezes. I have read that it is a mouse problem and rbair wrote that he "changed some symlinks to get it to be the one that our PI port seemed to be expecting (I don't remember the device ID off the top of my head).". I would like to experience javaFX sample, so, how can I solve my problem? How to change some symlinks related to mouse?

Thanks in advance and sorry for my "franglish" ( I'm french :mrgreen: ).
Posts: 2
Joined: Tue Jan 01, 2013 7:09 pm
by celli » Fri Jan 11, 2013 1:38 pm
Are you using a wireless keyboard/mouse? If so, switch to corded devices.

I had the same problem, but don't ask me why :)
Posts: 2
Joined: Fri Jan 11, 2013 1:36 pm
by danielblaukopf » Sat Jan 12, 2013 5:03 pm
Or you could try a) using a power supply for the Pi with a higher current rating or b) use USB devices that draw less power or c) connect USB devices through an independently powered USB hub. I usually use a 2A power supply and that copes well with a wired keyboard and mouse.

We're updating JavaFX for the Pi to be more tolerant of ups and downs in power to the USB ports, but one of the above options should help in the meantime.

Thanks,
Daniel
Posts: 42
Joined: Thu Dec 20, 2012 8:03 pm
by advanced » Fri Jan 18, 2013 4:28 pm
hi guys. I need your help in running the examples.
I followed all the steps involved of the official guide http://jdk8.java.net/fxarmpreview/javafx-arm-developer-preview.html#rpiconfig, in fact the command [url]sudo /opt/jdk1.8.0/bin/java -version[/url] display the correct output.

Now I'm not sure how I should run the example. The official guide provides an example which I don't understand ( and btw they forgot the "j" of jdk ) ...

Code: Select all
sudo /opt/dk1.8.0/bin/java -Djavafx.platform=eglfb -cp \
/opt/jdk1.8.0/jre/lib/jfxrt.jar:/tmp/JavaFXSamples/Stopwatch.jar \
stopwatch.MainScreen


First question, i'm not sure what the backslash at the end of the line does. For now I ignore it and write the command on a single line replacing my path to files:

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_examples[img][/img]/Stopwatch.jar stopwatch.MainScreen


And I get the following output :

Code: Select all
Error: Could not find or load main class stopwatch.MainScreen


Help a noob :D

EDIT : just to be sure that files are actually there, check it out yourself:

Code: Select all
pi@raspberrypi ~/javafx_examples $ pwd
/home/pi/javafx_examples
pi@raspberrypi ~/javafx_examples $ ls
BouncingBalls.html  Calculator.jar       FXML-LoginDemo.jnlp  SwingInterop_browser.jnlp
BouncingBalls.jar   Calculator.jnlp      StopWatch.html       samples_readme.txt
BouncingBalls.jnlp  Ensemble.html        StopWatch.jar        src
BrickBreaker.html   Ensemble.jar         StopWatch.jnlp       web-files
BrickBreaker.jar    Ensemble.jnlp        SwingInterop.html
BrickBreaker.jnlp   FXML-LoginDemo.html  SwingInterop.jar
Calculator.html     FXML-LoginDemo.jar   SwingInterop.jnlp
pi@raspberrypi ~/javafx_examples $
Posts: 36
Joined: Mon Dec 10, 2012 6:34 pm
Location: Rome
by henrik » Sat Jan 19, 2013 3:45 am
advanced wrote:hi guys. I need your help in running the examples.
I followed all the steps involved of the official guide http://jdk8.java.net/fxarmpreview/javafx-arm-developer-preview.html#rpiconfig, in fact the command [url]sudo /opt/jdk1.8.0/bin/java -version[/url] display the correct output.

Now I'm not sure how I should run the example. The official guide provides an example which I don't understand ( and btw they forgot the "j" of jdk ) ...

Code: Select all
sudo /opt/dk1.8.0/bin/java -Djavafx.platform=eglfb -cp \
/opt/jdk1.8.0/jre/lib/jfxrt.jar:/tmp/JavaFXSamples/Stopwatch.jar \
stopwatch.MainScreen


First question, i'm not sure what the backslash at the end of the line does. For now I ignore it and write the command on a single line replacing my path to files:

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_examples[img][/img]/Stopwatch.jar stopwatch.MainScreen


And I get the following output :

Code: Select all
Error: Could not find or load main class stopwatch.MainScreen


Help a noob :D

EDIT : just to be sure that files are actually there, check it out yourself:

Code: Select all
pi@raspberrypi ~/javafx_examples $ pwd
/home/pi/javafx_examples
pi@raspberrypi ~/javafx_examples $ ls
BouncingBalls.html  Calculator.jar       FXML-LoginDemo.jnlp  SwingInterop_browser.jnlp
BouncingBalls.jar   Calculator.jnlp      StopWatch.html       samples_readme.txt
BouncingBalls.jnlp  Ensemble.html        StopWatch.jar        src
BrickBreaker.html   Ensemble.jar         StopWatch.jnlp       web-files
BrickBreaker.jar    Ensemble.jnlp        SwingInterop.html
BrickBreaker.jnlp   FXML-LoginDemo.html  SwingInterop.jar
Calculator.html     FXML-LoginDemo.jar   SwingInterop.jnlp
pi@raspberrypi ~/javafx_examples $


Check your command line. Linux file names are case sensitive, and you are using "Stopwatch.jar" where it should be "StopWatch.jar".

The backslashes can be used to split up a Linux command line in several lines, they are not needed but are in the docs to clarify that it is a single long line. I will ask someone to check the capitalization in the docs and correct it if it is wrong.

Cheers -- Henrik (Oracle)
Posts: 65
Joined: Tue Dec 18, 2012 4:24 pm
by advanced » Sat Jan 19, 2013 11:12 am
Thank you for your help!

I actually tried different combinations of capitalization without any success .

Code: Select all
raspberrypi ~/javafx_examples $ sudo /opt/jdk1.8.0/bin/java -Djavafx.platform=eglfb -cp /opt/jdk1.8.0/jre/lib/jfxrt.jar:/home/pi/javafx_examples/StopWatch.jar StopWatch.MainScreen
Error: Could not find or load main class StopWatch.MainScreen
pi@raspberrypi ~/javafx_examples $ sudo /opt/jdk1.8.0/bin/java -Djavafx.platform=eglfb -cp /opt/jdk1.8.0/jre/lib/jfxrt.jar:/home/pi/javafx_examples/StopWatch.jar Stopwatch.mainscreen
Error: Could not find or load main class Stopwatch.mainscreen
pi@raspberrypi ~/javafx_examples $ sudo /opt/jdk1.8.0/bin/java -Djavafx.platform=eglfb -cp /opt/jdk1.8.0/jre/lib/jfxrt.jar:/home/pi/javafx_examples/StopWatch.jar Stopwatch.MainScreen
Error: Could not find or load main class Stopwatch.MainScreen
pi@raspberrypi ~/javafx_examples $ sudo /opt/jdk1.8.0/bin/java -Djavafx.platform=eglfb -cp /opt/jdk1.8.0/jre/lib/jfxrt.jar:/home/pi/javafx_examples/StopWatch.jar Stopwatch.Mainscreen
Error: Could not find or load main class Stopwatch.Mainscreen
pi@raspberrypi ~/javafx_examples $
Posts: 36
Joined: Mon Dec 10, 2012 6:34 pm
Location: Rome
by steveonjava » Tue Jan 22, 2013 9:25 pm
Try this command line:
sudo /opt/jdk1.8.0/bin/java -Djavafx.platform=eglfb -cp /opt/jdk1.8.0/jre/lib/jfxrt.jar:/home/pi/javafx_examples/StopWatch.jar stopwatch.MainScreen

FYI, the two bugs in the docs were:
* Missing "j" on jdk
* Incorrect capitalization on StopWatch.jar
Posts: 2
Joined: Tue Jan 22, 2013 9:22 pm
by advanced » Tue Jan 22, 2013 11:17 pm
thank you, now the example runs! :geek: . but. :|
This is the output I get :
Code: Select all
ES2Pipeline: OpenGL ES 2.0 embedded device detected
glGetError 0x500

The application works fine with the mouse and I'm able to click around...So, why that error?

Another question: How do I kill the fullscreen application? (Ctrl+c doesn't work)


And last but not least: I would like to use JavaFX with my USB 10" capacitive touchscreen (http://pikiosk.tumblr.com/post/41042790814/capacitive-touchscreen-raspberry).
Unfortunately, when i connect the touchscreen (USB) and try to run the example, the inputs doesn't work anymore and I'm not able to click around on the stopwatch... Any HINTS?
Posts: 36
Joined: Mon Dec 10, 2012 6:34 pm
Location: Rome
by SnakeDoc » Fri Jan 25, 2013 9:10 pm
Finally Supported Java on the PI!!!!!! So far i've been using OpenJDK-7 from the repo's, but getting early access to OpenJDK-8 is super awesome!!!!!

Java FTW!
Posts: 15
Joined: Fri Jan 25, 2013 9:04 pm
by steveonjava » Mon Jan 28, 2013 5:09 am
@Advanced - I get the same OpenGL error, and it is harmless. Remember, this is just an EA. ;)

For quitting your app use Platform.exit(). If you want you can capture Ctrl-C and invoke this, otherwise you can create a button or menu item to quit. (you can always force quit by terminating the Java process from another shell as well)

Poked someone on the touchscreen issue, but that is probably a better question for the JavaFX JIRA tracker.
Posts: 2
Joined: Tue Jan 22, 2013 9:22 pm
by advanced » Mon Jan 28, 2013 7:16 am
Thanks,i'll do it right away ;)

EDIT: done -> http://javafx-jira.kenai.com/browse/RT-27972 ... :!: Vote up please :!:
Posts: 36
Joined: Mon Dec 10, 2012 6:34 pm
Location: Rome
by danielblaukopf » Mon Jan 28, 2013 9:45 am
Thanks for the bug report.

I've just received my HDMI adapter from Chalkboard Electronics so I'll give this a try.
There's a question for you in the comments on the JIRA (let's continue this discussion there).

Daniel
Posts: 42
Joined: Thu Dec 20, 2012 8:03 pm
by akaptt » Mon Jan 28, 2013 7:24 pm
kermitas wrote:Does anybody run something non-javafx like Jetty, Tomcat, Glassfish or other servers?

How it works? Do you feel that it run better/faster?

Thanks:)


I am using a java distributed application framework with Jetty embedded. This framework was developed under eclipse and was designed to run on a network of "pizza box" linux servers (really high end) and also windows (only when we were forced to). Anyway, this embedded framework with a Jetty based servlet application running a highly interactive AJAX UI installed and ran on Raspberry Pi without a single code change of any kind. The few users that have used it so far said it's very fast and responsive. Definitely reliable.
Posts: 8
Joined: Mon Jan 28, 2013 2:15 am
by dms » Thu Feb 21, 2013 10:24 am
Hi,
I have just finished adapting the examples in a JavaFX tutorial by Alla Redko.
The tutorial can be found at
http://docs.oracle.com/javafx/2/ui_cont ... ntrols.htm
The documentation for my project is on my web pages under JavaFX
http://www.spanglefish.com/dmsconsulting/
The modified classes and source is on SourceForge
http://sourceforge.net/projects/rpjavafx/?source=navbar
Regards
Don
Posts: 12
Joined: Sun Jun 24, 2012 11:31 am
by freedomotic » Wed Feb 27, 2013 10:23 am
dms wrote:Hi,
I have just finished adapting the examples in a JavaFX tutorial by Alla Redko.
The tutorial can be found at
http://docs.oracle.com/javafx/2/ui_cont ... ntrols.htm
The documentation for my project is on my web pages under JavaFX
http://www.spanglefish.com/dmsconsulting/
The modified classes and source is on SourceForge
http://sourceforge.net/projects/rpjavafx/?source=navbar
Regards
Don


Thanks for your usefull documentation.
We are testing our domotic framework on the Raspberry. Following your website article we'll try to generate and test a freedomotic 5.4 headless on the raspi with the web client.
Regards
Freedomotic Open Source Building Automation
http://freedomotic.com
User avatar
Posts: 140
Joined: Sat Apr 21, 2012 3:59 pm
Location: Italy
by dms » Wed Feb 27, 2013 12:05 pm
Hi,

I am still developing PIFrame, now called PICrust (I could not resist it :D )
You can now setOnCloseRequest and intercept the window close.
I am working on getting re-size to work on the PI.

I will update the source and examples soon.

Regards
Don
Posts: 12
Joined: Sun Jun 24, 2012 11:31 am
by tobitobitobi » Wed Jul 23, 2014 5:44 pm
Hi guys, when can we expect to see the media classes like mediaplayer running on pi? Is this on Oracles roadmap? If not, where can we help with development?? I would love to use media on my pi.
Posts: 1
Joined: Wed Jul 23, 2014 5:42 pm