rlougher
Posts: 6
Joined: Mon Jul 23, 2012 9:39 am

Re: Java on Raspbian

Sat Aug 18, 2012 1:08 am

rlougher wrote: Once I've checked the changes into JamVMs GIT tree, I'll let Xerxes Randby know. Hopefully they'll then end up in IcedTea sometime...
Sorry for the delay, but the JamVM changes for Raspbian have made it into IcedTea. Here's the changeset for IcedTea6:

http://icedtea.classpath.org/hg/icedtea ... d3d110abfe

And the one for IcedTea7 (this took extra time as the latest OpenJDK 7 update contains changes that required extra work):

http://icedtea.classpath.org/hg/icedtea ... dfd32d5674

The actual commit to JamVMs GIT repository for the Raspbian changes is here (done 25th July):

http://git.berlios.de/cgi-bin/gitweb.cg ... 2bf15758c5

rlougher
Posts: 6
Joined: Mon Jul 23, 2012 9:39 am

Re: Java on Raspbian

Sat Aug 18, 2012 1:30 am

dacha wrote:
plugwash wrote:
rlougher wrote: A couple of minor changes are needed to get JamVM to work on raspbian (when I ported JamVM to armhf, I took the opportunity to use thumb2, as armhf specified this as a minimum requirement). Hopefully I'll check these changes in tonight.
Can you provide us a link to the patch, it would be good to be able to re-enable jamvm in our openjdk packages.
No need for a patch. The only problem JamVM has is that its own JNI invocation mechanism through src/os/linux/arm/callNativeEABI.S doesn't work correctly on Raspbian's hardfp ABI. But JamVM also supports using libffi as an alternative JNI mechanism, which works fine. You enable it as follows:

Code: Select all

./configure --enable-ffi
To clarify. JamVM has hand-written assembler for most platforms for calling JNI methods according to the platform ABI. It also supports using libffi to call JNI methods in a platform independent manner (as libffi handles all the platform details). By default, JamVM uses the hand-written routines as these are much faster than using libffi. On armhf, this is src/os/linux/arm/callNativeEABIHard.S (src/os/linux/arm/callNativeEABI.S is for armel). As armhf was previously only used on ARMv7, I used thumb2. For Raspbian, I have introduced yet another variant src/os/linux/arm/callNativeEABIHardARM.S which as the name suggests supports the EABI hard float ABI but is written in ARM mode so it works on ARMv6 processors such as in the Raspberry Pi. For other armhf targets the original routine is still used, as being thumb2 it is smaller, and (slightly) faster.

ota-kun
Posts: 36
Joined: Tue Jul 17, 2012 8:38 am

Re: Java on Raspbian

Tue Aug 21, 2012 12:45 pm

Are there any news on the progress concerning an Oracle hard float VM?

Btw.: I'm willing to volunteer as beta tester.

User avatar
mpthompson
Posts: 620
Joined: Fri Feb 03, 2012 7:18 pm
Location: San Carlos, CA
Contact: Website

Re: Java on Raspbian

Tue Aug 21, 2012 8:33 pm

I am scheduled to visit Richard at Oracle on Thursday afternoon. It sounds like they are making progress, but I don't know the specifics at this time. The best I can say right now is stay tuned.

rfincher1
Posts: 13
Joined: Sat May 26, 2012 5:09 am

Re: Java on Raspbian

Wed Aug 22, 2012 5:49 pm

This is from Henrik Stahl at Oracle:

" One caveat is that the current binary is softfloat ABI only, so it won't work with (for example) the Raspbian distribution which uses the hardfloat ABI. We are planning to add hardfloat support in an upcoming JDK release, as well as support for JavaFX on ARM."

Looks like light at the end of the tunnel! They are talking about Raspberry Pi and Raspbian by name, so that's a very good sign.

See the full post at:

https://blogs.oracle.com/henrik/entry/o ... _for_linux

Rick

pithonica
Posts: 8
Joined: Thu Jul 12, 2012 9:57 pm

Re: Java on Raspbian

Thu Aug 23, 2012 3:31 pm

Some comments on schedule in that blog post:

"The initial release of the Oracle JDK for ARM uses the softfloat ABI and so works on softfloat distributions, or hardfloat with softfloat compatibility, but not on hardfloat. This is just a matter of timing - we will provide a hardfloat JDK at some point in the future. It will likely be done iteratively, so we may for instance deliver ARMv7 first and ARMv6 later, and the initial release may be headless so no Swing/AWT. We will produce public early access builds as soon as we are able and make them available on java.net. We don't have any dates to share yet, but will hopefully be able to provide a roadmap at JavaOne 2012."

User avatar
mpthompson
Posts: 620
Joined: Fri Feb 03, 2012 7:18 pm
Location: San Carlos, CA
Contact: Website

Re: Java on Raspbian

Fri Aug 24, 2012 3:44 am

I had a terrific meeting with Richard Bair at Oracle today to discuss their progress on an official Java VM that would support the Raspbian flavor of armhf. I was very pleased to see working projects with optimized VMs that I believe greatly demonstrate the potential of Java on the Raspberry Pi. There seems to be genuine excitement on his team about the capabilities of Java running on such an inexpensive, yet very capable device. Particularly the educational potential which is in perfect alignment with the goals of the Raspberry Pi Foundation.

Unfortunately, I really can't go into any timelines because much of it is still being worked out (and it would be inappropriate to say anything anyway). Richard indicated that for now nothing is official and that a roadmap for Oracle officially supporting Java on the Raspberry Pi with Raspbian armhf may be announced at the JavaOne conference in about 5 weeks from now. I'll keep my fingers crossed that timelines and commitments are clarified at that time and that we'll see an official release from Oracle at some point in the future.

In the meantime, the Oracle Java VM is supported on the Raspberry under Debian armel.

belgaroo
Posts: 1
Joined: Wed Aug 29, 2012 11:52 pm

Re: Java on Raspbian

Wed Aug 29, 2012 11:56 pm

I also need this.

Once the gods have solved the issue I would be happy to write up a recipe to get an example application running on the pi.

Thanks to the Java team for taking an interested- much appreciated!

uberscubajim
Posts: 162
Joined: Thu Jun 21, 2012 12:22 pm
Location: Ipswich, Suffolk. UK.

Re: Java on Raspbian

Thu Aug 30, 2012 1:55 pm

Can I just ask a really stupid question here.

The processor on the Pi supports the Java instruction set via the Jazelle extension. Is there a reason that this isn't being used?

I know that this is quite an academic question but it does seem odd to have that hardware support and then not use it.

Jim.

v6ak
Posts: 9
Joined: Fri Aug 03, 2012 9:58 am

Re: Java on Raspbian

Thu Aug 30, 2012 3:17 pm

As far as I know:
* Jazelle is not very fast. Modern JIT (consumes more RAM) or AOT (ahead of time compiler, needs cache for fast start) perform often better.
* It may need J2ME StackMap and old JVM bytecode version, but I am not sure.
* It requires implementation of those instructions; it is just an optimized interpreter.
* There is neither any free-of-charge nor any opensource implementation of JVM vith Jazelle.
* Jazelle is not likely to be supported in future ARM processors, since there is ThumbEE in future ARM processors.

Kidikarus
Posts: 1
Joined: Thu Aug 30, 2012 6:10 pm

Re: Java on Raspbian

Thu Aug 30, 2012 6:25 pm

Jan77,

Have you had any further luck on getting your knoplerfish onto the pi? Do you have a lessons learned from your arm5 effort? We use Virgo and I am guessing its a similar process.

User avatar
Jim Manley
Posts: 1600
Joined: Thu Feb 23, 2012 8:41 pm
Location: SillyCon Valley, California, and Powell, Wyoming, USA, plus The Universe
Contact: Website

Re: Java on Raspbian

Fri Sep 14, 2012 6:00 pm

liz wrote:NoisebridgeOracle: The JavaFX engineering team will be coming along to demonstrate Java and JavaFX running on the Raspberry Pi
This will be the Foundation-sponsored hackerspace visit by Rob Bishop on 29 September in San Francisco. Will Mike Thompson of Raspbian, Richard Bair of Oracle, or others involved in their efforts be at the Noisebridge, Hacker Dojo (Mountain View), or Stanford events (the latter two will be on 30 September and 1 October, respectively)? I plan to attend all three to help demo things, show an Atrix lapdock PiTop, and make attendees aware of the monthly Silicon Valley Raspberry Jams and Peninsula Raspberry Pi Meetup group.
The best things in life aren't things ... but, a Pi comes pretty darned close! :D
"Education is not the filling of a pail, but the lighting of a fire." -- W.B. Yeats
In theory, theory & practice are the same - in practice, they aren't!!!

User avatar
mpthompson
Posts: 620
Joined: Fri Feb 03, 2012 7:18 pm
Location: San Carlos, CA
Contact: Website

Re: Java on Raspbian

Fri Sep 14, 2012 11:36 pm

I guess I better start making my plans now to attend. All three are within easy driving distance for me, but I need to check for calendar conflicts.
Jim Manley wrote:
liz wrote:NoisebridgeOracle: The JavaFX engineering team will be coming along to demonstrate Java and JavaFX running on the Raspberry Pi
This will be the Foundation-sponsored hackerspace visit by Rob Bishop on 29 September in San Francisco. Will Mike Thompson of Raspbian, Richard Bair of Oracle, or others involved in their efforts be at the Noisebridge, Hacker Dojo (Mountain View), or Stanford events (the latter two will be on 30 September and 1 October, respectively)? I plan to attend all three to help demo things, show an Atrix lapdock PiTop, and make attendees aware of the monthly Silicon Valley Raspberry Jams and Peninsula Raspberry Pi Meetup group.

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

Re: Java on Raspbian

Sun Sep 23, 2012 12:48 am

I have great results using JamVM on Raspbian in combination with OpenJDK especially well suited for applications using Java2D and OpenGL ES 2.
http://www.raspberrypi.org/phpBB3/viewt ... 91#p177791

This Raspbian compatible JamVM is included in the last IcedTea 7 2.3.1 release and the 2.3.2 that contains all the recent Java 7 security fixes.
It would be beneficial if JamVM got built and shipped by default possibly by re-building the latest Ubuntu OpenJDK 7 package on Rasbian.
https://launchpad.net/ubuntu/+source/openjdk-7
This 2.3.2a package also contains one extra patch for JamVM that is currently not found in IcedTea or JamVM upstream to make JamVM match the libjvm.so SONAME used by hotspot.
http://bazaar.launchpad.net/~ubuntu-bra ... evision/30
This enables the OpenJDK 7 libjava.so to find the jamvm libjvm.so out of the box.

For the OpenJDK 6 package you may use this patch
http://icedtea.classpath.org/hg/icedtea ... 1137cef484
to use the latest JamVM in combination with IcedTea6 1.11.x before the next IcedTea 6 1.12 hits the streets.

Quick manual JamVM build instructions for OpenJDK-6 http://labb.zafena.se/?p=576
Xerxes Rånby @xranby I once had two, then I gave one away. Now both are in use every day!
twitter.com/xranby

plugwash
Forum Moderator
Forum Moderator
Posts: 3454
Joined: Wed Dec 28, 2011 11:45 pm

Re: Java on Raspbian

Mon Sep 24, 2012 10:01 pm

dacha wrote: Since you manage the repository, let me report that the CACAO JVM already in that repository definitely isn't clean, as all it takes to crash it is this:
mmm, thanks for providing a crash recipe, I can reproduce your crash.

It's not a raspbian specific issue though. Debian armhf on my beagleboard XM has the same problem.

bugs filed in debian.
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=688702
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=688703

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

Re: Java on Raspbian

Tue Sep 25, 2012 9:24 am

plugwash wrote: It's not a raspbian specific issue though. Debian armhf on my beagleboard XM has the same problem.

bugs filed in debian.
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=688702
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=688703
Thank you or the bugreports i will forward them to the CACAO maintainer Stefan Ring.
We will soon update CACAO in IcedTea6 to include the CACAO 1.6.0 release that brings in some more bugfixes.
xranby wrote:It would be beneficial if JamVM got built and shipped by default possibly by re-building the latest Ubuntu OpenJDK 7 package on Rasbian.
https://launchpad.net/ubuntu/+source/openjdk-7
This 2.3.2a package also contains one extra patch for JamVM that is currently not found in IcedTea or JamVM upstream ...
For the OpenJDK 6 package you may use this patch
http://icedtea.classpath.org/hg/icedtea ... 1137cef484
This fix is now in JamVM upstream:
http://mail.openjdk.java.net/pipermail/ ... 20346.html
http://git.berlios.de/cgi-bin/gitweb.cg ... 3a5db90d82

The Debian maintainer Florian Weimer have started an ongoing discussion, Status of non-Hotspot VMs and Shark, on the distro-pkg-dev mailinglist to select which JVM to ship with the next Debian stable release.
http://markmail.org/message/tumzgkop6kqpklsw
Xerxes Rånby @xranby I once had two, then I gave one away. Now both are in use every day!
twitter.com/xranby

plugwash
Forum Moderator
Forum Moderator
Posts: 3454
Joined: Wed Dec 28, 2011 11:45 pm

Re: Java on Raspbian

Tue Sep 25, 2012 11:32 am

We should have an openjdk 7 based jamvm in raspbian soon. I just tested a build based on the package from debian experimental and it seems to come out clean and run test programs ok. Thanks to all of you who made this happen.

Unfortunately I screwed up the versioning when forward porting raspbian changes. So I need to do another overnight rebuild before it can hit the repo.

plugwash
Forum Moderator
Forum Moderator
Posts: 3454
Joined: Wed Dec 28, 2011 11:45 pm

Re: Java on Raspbian

Wed Sep 26, 2012 8:29 am

Ok icedtea-7-jre-jamvm is now in the repo

Thanks to everyone who helped make this happen

Keelhaul
Posts: 10
Joined: Fri Aug 24, 2012 1:06 pm

Re: Java on Raspbian

Wed Sep 26, 2012 10:13 am

Can anyone tell how OpenJDK7 on Raspbian performs compared to Oracle JDK7 on Armel nowdays?

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

Re: Java on Raspbian

Wed Sep 26, 2012 10:41 am

Keelhaul wrote:Can anyone tell how OpenJDK7 on Raspbian performs compared to Oracle JDK7 on Armel nowdays?
When i test real time applications like a Java2D game then i get
28fps using JamVM + OpenJDK7 + Rasbian
compared to
23fps using Oracle JDK7 7u6 + Debian armel

Which kind of application do you have in mind?
Last edited by xranby on Wed Sep 26, 2012 10:53 am, edited 1 time in total.
Xerxes Rånby @xranby I once had two, then I gave one away. Now both are in use every day!
twitter.com/xranby

plugwash
Forum Moderator
Forum Moderator
Posts: 3454
Joined: Wed Dec 28, 2011 11:45 pm

Re: Java on Raspbian

Wed Sep 26, 2012 10:46 am

AIUI openjdk using the default "zero" vm is SLOW. openjdk using jamvm is fast but there are a few java features it doesn't support.

Keelhaul
Posts: 10
Joined: Fri Aug 24, 2012 1:06 pm

Re: Java on Raspbian

Wed Sep 26, 2012 10:48 am

Ok thanks. Could you tell me what features aren't supported?

plugwash
Forum Moderator
Forum Moderator
Posts: 3454
Joined: Wed Dec 28, 2011 11:45 pm

Re: Java on Raspbian

Wed Sep 26, 2012 11:40 am

I'm not a java expert myself I was just going by what I read earlier in this thread, specifically jan77's comment earlier in this thread.

Keelhaul
Posts: 10
Joined: Fri Aug 24, 2012 1:06 pm

Re: Java on Raspbian

Wed Sep 26, 2012 12:02 pm

xranby wrote: When i test real time applications like a Java2D game then i get
28fps using JamVM + OpenJDK7 + Rasbian
compared to
23fps using Oracle JDK7 7u6 + Debian armel

Which kind of application do you have in mind?
My application is heavy on capturing images (using JMF, which I'm not even sure will work on an ARM architecture as there don't seem to be any native libs) and audio and sending them via UDP.

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

Re: Java on Raspbian

Wed Sep 26, 2012 12:13 pm

Keelhaul wrote:
xranby wrote: When i test real time applications like a Java2D game then i get
28fps using JamVM + OpenJDK7 + Rasbian
compared to
23fps using Oracle JDK7 7u6 + Debian armel

Which kind of application do you have in mind?
My application is heavy on capturing images (using JMF, which I'm not even sure will work on an ARM architecture as there don't seem to be any native libs) and audio and sending them via UDP.
http://fmj-sf.net/
FMJ is an open-source project with the goal of providing an alternative to Java Media Framework (JMF), while remaining API-compatible with JMF. It aims to produce a single API/Framework which can be used to capture, playback, process, and stream media across multiple platforms.

https://jogamp.org/
You may also use JogAmp that can do hardware accelerated video playback, YUV to RGB color conversion using fragment shaders, on the Pi.
Xerxes Rånby @xranby I once had two, then I gave one away. Now both are in use every day!
twitter.com/xranby

Return to “Raspbian”