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

Re: Java on Raspbian

Wed Sep 26, 2012 2:18 pm

Thanks, I've checked out FMJ before, but it didn't work with my JMF code, and the FPS rates on their website looked meager so I didn't pursue that further. I guess now I don't have any other choice. Don't I need a native lib-civil for ARM?

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

Re: Java on Raspbian

Fri Sep 28, 2012 8:35 am

Keelhaul wrote:Thanks, I've checked out FMJ before, but it didn't work with my JMF code, and the FPS rates on their website looked meager so I didn't pursue that further. I guess now I don't have any other choice. Don't I need a native lib-civil for ARM?
FMJ use LTI-CIVIL http://lti-civil.org/ as a replacement for the encumbered JMF libcivil.so.
You will need to recompile the LTI-CIVIL libcivil.so for ARM in order to get FMJ running.
I agree with you LTI-CIVIL looks like a major bottleneck and i do only expect meager framerates after porting FMJ and LTI-CIVIL to ARM. :|

There do exist one alternative choice to capture images using a video/webcam source from java:
v4l4j - A java package to access the Capture interface of the Video4Linux API
v4l4j is already tested and found to be working on the Raspberry Pi :)
https://code.google.com/p/v4l4j/wiki/Ge ... artedOnRPi
Last edited by xranby on Fri Sep 28, 2012 8:42 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

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

Re: Java on Raspbian

Fri Sep 28, 2012 8:41 am

This is getting a bit OT, sorry. :oops:

Anyway, I've tried v4l4j the other day, and I could run a streaming server and watch the stream with VLC (at ~6fps on Armel + Oracle JVM). What I need are individual frames as BufferedImages, though, because I need to process them.

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

Re: Java on Raspbian

Thu Oct 04, 2012 12:47 am

xranby wrote: 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.
I tried and failed to merge that change with the latest openjdk-6 packaging from sid. I noticed that the old version of jamvm was different in sid than it was in the version you patched. I don't remember the exact error but it was something about unsupported class libraries or so. I tried both with and without the change to --with-java-runtime-library

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

Re: Java on Raspbian

Sat Oct 06, 2012 9:54 pm

I tried video capturing with v4l4j on armel+Oracle JDK7 as well as raspbien+OpenJDK. So far, the OpenJDK execution seems much slower...

How can I make sure it's using JamVM? I did the following:

Code: Select all

1) apt-get install openjdk-7-jdk
2) apt-get install icedtea-7-jre-jamvm


"java -version" returns this:

Code: Select all

java version "1.7.0_07"
OpenJDK Runtime Environment (IcedTea7 2.3.2) (7u7-2.3.2a-1+rpi1)
OpenJDK Zero VM (build 22.0-b10, mixed mode)
Is there a way to tell which JVM is used or influence that?

Thanks!

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

Re: Java on Raspbian

Sat Oct 06, 2012 10:20 pm

You can select jamvm from the command line using -jamvm.

According to xerces there is also a way to make it the default by editing a configuration file. See his post in http://www.raspberrypi.org/phpBB3/viewt ... 66&t=19117 for details. I have not tried this method myself though.

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

Re: Java on Raspbian

Sun Oct 07, 2012 10:12 pm

Ok thanks. However, now with the flag the classpath seems to have changed. Usually I put required JARs into /usr/lib/jvm/java-7-openjdk-armhf/jre/lib/ext/ (or rather make symlinks to the actual JARs in /usr/share/java/). Where does JamVM expect its jars?

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

Re: Java on Raspbian

Mon Oct 08, 2012 6:33 am

Keelhaul wrote:Ok thanks. However, now with the flag the classpath seems to have changed. Usually I put required JARs into /usr/lib/jvm/java-7-openjdk-armhf/jre/lib/ext/ (or rather make symlinks to the actual JARs in /usr/share/java/). Where does JamVM expect its jars?
JamVM expects user jars to be explicitly specified on the command line using the -classpath or in short -cp command line option.

I think you can add the ext folder to the bootclasspath by specifying -Xbootclasspath
The "problem" with adding jars using the ext folder or using Xbootclasspath is that jars added there can easily replace core JavaSE functionality like the standard java classes, system wide, and is thus considered unsafe and may introduce hard to find bugs. It is much better to add jars using the -classpath option from a security viewpoint.

If you find that the default JamVM classpath or bootclasspath behave different compared to Zero/Hotspot then please report it to the jamvm-general mailinglist and include a testcase that demonstrate the difference.
https://lists.sourceforge.net/lists/lis ... vm-general
Xerxes Rånby @xranby I once had two, then I gave one away. Now both are in use every day!
twitter.com/xranby

apostoly
Posts: 2
Joined: Sat Oct 13, 2012 8:23 am

Re: Java on Raspbian

Sat Oct 13, 2012 8:26 am

Just to keep posted on the progress of this thread.

In the meantime, I can't find a repository with a compiled icedtea ? apt-get install icedtea7 does nothing on my raspbmc raspberry, any clue ?

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

Re: Java on Raspbian

Tue Oct 16, 2012 11:17 am

apostoly wrote:Just to keep posted on the progress of this thread.

In the meantime, I can't find a repository with a compiled icedtea ? apt-get install icedtea7 does nothing on my raspbmc raspberry, any clue ?
To install OpenJDK 7 Zero get:
http://packages.debian.org/sid/openjdk-7-jdk
Zero is stable but somewhat slow, interpreter only.

Code: Select all

apt-get update
apt-get install openjdk-7-jdk

java -version
To install JamVM get:
http://packages.debian.org/sid/icedtea-7-jre-jamvm
JamVM is both stable and fast, Includes a code copying JIT!

Code: Select all

apt-get install icedtea-7-jre-jamvm

java -jamvm -version
To install Avian get:
http://packages.debian.org/sid/jvm-7-avian-jre
Avian is currently under heavy developement/testing and is still somewhat unstable for some workloads: Please report issues/bugs to: https://groups.google.com/forum/?fromgr ... orum/avian
Includes a JIT!

Code: Select all

# Currently only found in Debian Unstable and Ubuntu Quantal
# Please build it for Raspbian
# package jvm-7-avian-jre
# Manual build instructions: http://labb.zafena.se/?p=630
# Manual download and install of a pre-built avian libjvm.so
cd /usr/lib/jvm/java-7-openjdk-armhf/jre/lib/arm
mkdir avian
cd avian
wget http://labb.zafena.se/avian/armhf-armv6-20121015/libjvm.so

java -avian -version
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: 3435
Joined: Wed Dec 28, 2011 11:45 pm

Re: Java on Raspbian

Sun Oct 28, 2012 1:19 pm

Just to let you guys know i've now finally managed to produce a clean icedtea6-jre-jamvm package. It should hit the repo soon.

User avatar
jackokring
Posts: 816
Joined: Tue Jul 31, 2012 8:27 am
Location: London, UK
Contact: ICQ

Re: Java on Raspbian

Sun Oct 28, 2012 3:35 pm

plugwash wrote:Just to let you guys know i've now finally managed to produce a clean icedtea6-jre-jamvm package. It should hit the repo soon.
It hit Mint Linux 2 days ago. :)
Pi[NFA]=B256R0USB CL4SD8GB Raspbian Stock.
Pi[Work]=A+256 CL4SD8GB Raspbian Stock.
My favourite constant 1.65056745028

dms
Posts: 15
Joined: Sun Jun 24, 2012 11:31 am

Re: Java on Raspbian

Fri Nov 16, 2012 4:50 pm

Hi,
The currect ejres supplied by Oracle -
ejre-7u6-fcs-b24-linux-arm-vfp-client_headless-10_aug_2012.tar.gz
are very interesting and the clue is the 'vfp' in the name.
vfp stands for Vector Floating Point which is the floating point hardware
in the Raspberry PI. See this article from Oracle -
http://files.meetup.com/1401221/CLE-JUG ... i-v1_0.pdf.
This all suggests that this Java may have vector floating point code for the arm. It might just be floating point but the JIT might be able to use the
vector instructions - that will make the fp very fast !!

The question I have is why the ejre fails with libjli.so: cannot open shared object file: No such file or directory ... What is it about Raspbian that stops
the Java working?
Regards
Don

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

Re: Java on Raspbian

Fri Nov 16, 2012 5:03 pm

It is a bit strange:

"ARMv6/7 Linux - Headless EABI, VFP, SoftFP ABI, Little Endian1"

So, it probably uses hard FP, but it requires SoftFP ABI.

konstantin
Posts: 1
Joined: Tue Nov 27, 2012 1:50 pm

OSGi M2M Solution on Raspberry Pi

Tue Nov 27, 2012 1:56 pm

I would like to inform you that our ProSyst mBS OSGi can be run on Raspberry Pi.

You can find the full article and a summarizing paper here: http://ow.ly/fBEo1

Regards,

Konstantin

Stuntman
Posts: 2
Joined: Thu Nov 29, 2012 11:04 pm

Re: Java on Raspbian

Thu Nov 29, 2012 11:08 pm

plugwash wrote:Just to let you guys know i've now finally managed to produce a clean icedtea6-jre-jamvm package. It should hit the repo soon.
Was this package released? How would I go about getting it?
Thanks!

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

Re: Java on Raspbian

Fri Nov 30, 2012 8:22 am

I asked Oracle at https://blogs.oracle.com/javaone/entry/ ... ava_on_the (see comments) if they still release a JVM for armhf (Raspbian). It's still on their Roadmap, but they can't tell when.

I wouldn't be surprised that it is released with Java 8, because they used a Java 8 EA version at JavaOne. But only Oracle knows. Current release date is 2013/09/09 .

So for now use either
Debian armel (soft float) with Oracle embedded, when you need best Java performance
or
Raspbian (hard float) with some kind of OpenJDK implementation, when Java performance is not that important.

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

Re: Java on Raspbian

Sat Dec 01, 2012 8:20 pm

ota-kun wrote: So for now use either
Debian armel (soft float) with Oracle embedded, when you need best Java performance
or
Raspbian (hard float) with some kind of OpenJDK ...
There is some Java features that is not inluced in the Oracle JRE and JDK builds and only found using OpenJDK: found in the openjdk-6-jdk and openjdk-7-jdk packages.

Use OpenJDK if you want to use javaws JNLP webstart deployment, and web browser Java applet support by installing the icedtea-plugin package.
Use OpenJDK if you want to use the IcedTea PulseAudio backend for sound.
Use OpenJDK if you want a license that allows free distribution of the Raspberry Pi applications used in embedded and kiosk systems.
Use OpenJDK if you want to take advantage of armhf optimized system libraries.

You got many great community supported JVM that you can use in combination with OpenJDK.
I recommend you to try
JamVM: java -jamvm from the icedtea-6-jre-jamvm and icedtea-7-jre-jamvm package
Avian: java -avian from the jvm-7-avian-jre package
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: 3435
Joined: Wed Dec 28, 2011 11:45 pm

Re: Java on Raspbian

Sat Dec 01, 2012 8:41 pm

xranby wrote:Avian: java -avian from the jvm-7-avian-jre package
Avian is not currently in raspbian because it's not in debian wheezy.

Does avian have any significant advantages over jamvm? how stable is it? do you think I should attempt to manually bring it into raspbian?

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

Re: Java on Raspbian

Sat Dec 01, 2012 10:03 pm

plugwash wrote:Does avian have any significant advantages over jamvm?
The Avian JIT produces fast code on the Raspberry Pi. http://www.raspberrypi.org/phpBB3/viewt ... 55#p160655
Avian is well suited to building small, self-contained applications: http://oss.readytalk.com/avian/examples.html
In this regard Avian is more suited compared to the Oracle JRE to deploy applications written in Java in low footprint embedded environments.
plugwash wrote:how stable is it?
Most applications now run fine using Avian. Avian got a good support team that is agile and help fix bugs if they get reported in. https://github.com/ReadyTalk/avian/commits/master
JamVM is all around stable, we currently got no known instability bugs, therefore we have had no new commits to JamVM during the last two months. http://git.berlios.de/cgi-bin/cgit.cgi/jamvm/
plugwash wrote:do you think I should attempt to manually bring it into raspbian?
Yes, it is easy to build, and getting more testers will surely help iron out any remaining instability issues.
Xerxes Rånby @xranby I once had two, then I gave one away. Now both are in use every day!
twitter.com/xranby

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

Re: Java on Raspbian

Sat Dec 01, 2012 11:01 pm

xranby wrote:JamVM is all around stable, we currently got no known instability bugs, therefore we have had no new commits to JamVM during the last two months. http://git.berlios.de/cgi-bin/cgit.cgi/jamvm/
Just to clarify, no new commits doesn't mean JamVM is dead! I'm still actively working on it (albeit in my strictly limited free time). I hope to commit initial support for JSR 292 (method handles, invokedynamic, etc.) within the next few weeks. This will be for OpenJDK 8 (I partially implemented it for OpenJDK 7 but abandoned it when I realised it was a dead end, due to JSR 292 being reimplemented in OpenJDK 8 via Lambda-Forms).

Rob.

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

Re: Java on Raspbian

Sat Dec 01, 2012 11:19 pm

rlougher wrote:
xranby wrote:JamVM is all around stable, we currently got no known instability bugs, therefore we have had no new commits to JamVM during the last two months. http://git.berlios.de/cgi-bin/cgit.cgi/jamvm/
Just to clarify, no new commits doesn't mean JamVM is dead! I'm still actively working on it (albeit in my strictly limited free time). I hope to commit initial support for JSR 292 (method handles, invokedynamic, etc.) within the next few weeks. This will be for OpenJDK 8 (I partially implemented it for OpenJDK 7 but abandoned it when I realised it was a dead end, due to JSR 292 being reimplemented in OpenJDK 8 via Lambda-Forms).

Rob.
Thank you Robert for JamVM!
Blocky is a good example on how you can use use JamVM OpenJDK and LWJGL to run fullscreen 60fps GPU hardware accelerated OpenGL ES applications on the Pi using Raspbian:
http://www.raspberrypi.org/phpBB3/viewt ... 70#p218470
Xerxes Rånby @xranby I once had two, then I gave one away. Now both are in use every day!
twitter.com/xranby

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

Re: Java on Raspbian

Sat Dec 01, 2012 11:40 pm

xranby wrote: Thank you Robert for JamVM!
Hi Xerxes,

Don't worry, I took no offence at your comment about the lack of commits! As you said, the main branch of JamVM appears to be stable, and no bug fixes have been needed for quite a while.
xranby wrote: Blocky is a good example on how you can use use JamVM and OpenJDK to run fullscreen 60fps a hardware accelerated OpenGL ES applications on the Pi using Raspbian:
http://www.raspberrypi.org/phpBB3/viewt ... 70#p218470
Yes, that looks impressive, and follows on from your work with OpenGL ES support, etc. One of these days I hope to run it on my Pi (maybe over Christmas).

Thanks,
Rob.

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

Re: Java on Raspbian

Sun Dec 02, 2012 1:20 am

xranby wrote: Yes, it is easy to build, and getting more testers will surely help iron out any remaining instability issues.
Ok I brought in the sid version of avian, it built ok and passed our contamination checker but I haven't actually tested it to see if it works.

khooke
Posts: 25
Joined: Sun Oct 07, 2012 6:38 am
Location: CA, USA
Contact: Website

Re: Java on Raspbian

Tue Dec 11, 2012 4:19 pm

I was convinced I had burned the softfp version of wheezy to my sd card, but I ran into the libjli.so error trying to run Java SE Embedded, and what do you know, I had actually downloaded the wrong image :lol:

Once I downloaded the wheezy armel version then everything works as expected.

Is there a command to run or some file to check to see whether you're running the softfp or hardfp version of Debian? Since I was sure I was running the correct version, a command to run to doublecheck would have been useful. I imagine this would be useful for others that are running into this issue too ('run this... if you see this... then you're running the wrong version of the os....')

Thanks! Kevin

Return to “Raspbian”