Java on Raspbian

I would love to be able to run the Oracle EJRE on Raspbian. I don't understand the ABI issues enough but is the soft-float EJRE unable to run because the loader is unable to link in the so? Or is it because the libc is incompatible?

neaso wrote:Using strace I watched java try and load the libjli.so and still give me the error. Leading me to believe that it didn't know how to load an so of that type.

Yes, this is correct. As far as Debian/Raspbian Wheezy armhf is concerned, the armel packages are as alien to it as i386 packages and it will refuse to load or perform runtime linking.

neaso wrote:Is there a fundamental reason why a system can't run both types of calling conventions?

Theoretically, it should be possible to run Debian Wheezy armel binaries on a Debian Wheezy armhf system (which is essentially what Raspbian is) using a mechanism called multiarch. I don't know much about it other than that it exists. Plugwash seems more familiar with the technology and may able to provide an answer as to why or why not it may be a possible solution for packages only supported under Debian armel. I don't believe it's fully implemented yet, but the good news is that Debian is targetting armhf as one of the platforms for it to be working on first.

Your benchmark results for JamVM are rather low. Can you tell me which configure options you used and the gcc version? Also, just to be clear, you are testing JamVM with GNU Classpath, and not OpenJDK?

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.

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.

plugwash wrote:Can you provide us a link to the patch, it would be good to be able to re-enable jamvm in our openjdk packages.

I'll check it in some time tonight (UK time) and generate a patch, though I'm not sure if the patch will be much use. This is where my ignorance of both the IcedTea build system and its Debian package comes in...

JamVM, when configured for OpenJDK, provides a libjvm.so. For testing purposes I just copy this over an existing IcedTea/OpenJDK install.

Unfortunately, I didn't do the build changes to IcedTea for JamVM. So how JamVM gets built as part of IcedTea, and how the libjvm.so ends up in the package is mostly a mystery to me (I do know it downloads a snapshot of JamVMs GIT tree). 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...

Well debian packages aren't allowed to download anything during package build so the source must be in the debian source package somewhere, it's "just" a matter of finding out where it is and how to apply a patch to it.

mpthompson wrote:Java is a place where Raspbian could really use help from people in the Raspberry Pi community who have an interest in Java. There are similar issues with Mono as well. Hopefully some very experienced Java developers can examine the Debian openjdk package and other Java related packages and tell us what changes need to be made to the build configurations to improve Java support. Plugwash and I try to do the best we can, but our experience with Java is very limited and our ability to really test and optimize the builds is limited as well.

My first and based target is to use rpi with Java. Until now I used Oracle Embedded Java 7.

I have two questions:- is it possible that one of this commands apt-get update, apt-get upgrade or rpi-update automatically switched me from Squeeze to Wheezy hardfp?? (is it safe to do updates, I don't want to be switched form softfp to hardfp...)- will Debian Squeeze repositories for rpi be updated in future ? (or all work will go to Wheezy hardfp and Java users will have to use old, never updated software)

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:

My first and based target is to use rpi with Java. Until now I used Oracle Embedded Java 7.

I have two questions:- is it possible that one of this commands apt-get update, apt-get upgrade or rpi-update automatically switched me from Squeeze to Wheezy hardfp?? (is it safe to do updates, I don't want to be switched form softfp to hardfp...)- will Debian Squeeze repositories for rpi be updated in future ? (or all work will go to Wheezy hardfp and Java users will have to use old, never updated software)

kermitas wrote:- is it possible that one of this commands apt-get update, apt-get upgrade or rpi-update automatically switched me from Squeeze to Wheezy hardfp?? (is it safe to do updates, I don't want to be switched form softfp to hardfp...)

Upgrades will not switch you from armel to armhf, you have nothing to worry about there.

- will Debian Squeeze repositories for rpi be updated in future ? (or all work will go to Wheezy hardfp and Java users will have to use old, never updated software)

Debian squeeze is a stable release and as such the only updates it will likely get from debian will be security updates etc.

For the Pi specific stuff you can either use rpi-update or install friggle's packages

Yes, I have just discovered that I can use Wheezy softfp from here http://www.raspberrypi.org/archives/1435 (2012-06-18-wheezy-beta.zip). I read that it is better than Squeeze. Now I am updating it (apt-get update, apt-get upgrade, rpi-update).

What about 2012-06-18-wheezy-beta.zip repositories? Will they be always up-to-date?

Andy, looking at what's available at that site, I don't see any binaries that are supported by Raspbian. The armv6 binaries use the soft float ABI (armel) which is incompatible with Raspbian. Even their armv7 binaries use the soft float ABI which I find a little curious, but there is probably a good reason for that from their perspective.

I live about two miles from the Oracle headquarters in Redwood Shores, CA and I would be happy to see what I could to help them create armv6 hard float ABI (armhf) binaries that would run under Raspbian, but someone would have to contact Oracle to see if there is interest on their behalf.

I'm the Java Client Architect at Oracle. We're both very interested in supporting the Raspberry PI, not only with JavaSE Embedded but also with JavaFX. We have an alpha hard-float JVM and I'm going to be giving it a try along with recompiled JavaFX binaries in hard float to see how this device is going to look.

mpthompson, I'd love for you to come down to the Oracle campus in Santa Clara if you have a chance and I'll show you what we've been working on and spend a little time investigating what could potentially be done in Raspbian in terms of configuration / libraries / performance. If nothing else it should be a lot of fun .

rbair wrote:I'm the Java Client Architect at Oracle. We're both very interested in supporting the Raspberry PI, not only with JavaSE Embedded but also with JavaFX. We have an alpha hard-float JVM and I'm going to be giving it a try along with recompiled JavaFX binaries in hard float to see how this device is going to look.

mpthompson, I'd love for you to come down to the Oracle campus in Santa Clara if you have a chance and I'll show you what we've been working on and spend a little time investigating what could potentially be done in Raspbian in terms of configuration / libraries / performance. If nothing else it should be a lot of fun .

I talked to some folks from Oracle at the Java education booth at the Maker Faire back in May about Java products being made as compatible with the Pi as possible (especially to take advantage of the FPU and GPU). I was assured that there was high interest, at least among the engineering folks, in that happening for all current and future Java releases. The last I had heard through informal channels was that there were multiple Oracle offices interested in the effort and that they were working out which office was officially going to be lead and what each of the other interested offices might contribute. No timeframe for releases beyond the general Java product roadmap had been developed, but, JavaFX compliance by sometime this coming Fall seemed to be an unofficial goal. Future major numbered Java releases including full Pi support at the same time as other supported platforms was reportedly the long-term goal.

Since the Pi is officially aimed at the educational sector and the folks I talked to are in Oracle's Java educational division, they said that full Java product support for the Pi would fit well within Oracle's business model and long-term strategy. The thinking is similar to how Apple achieved very high penetration in both K-12 and collegiate segments in the U.S. by not only offering essentially at-cost discounts to students and faculty on Apple ][ and Mac hardware and software.

Graduating users carried their experience and passionate brand affinity into the commercial world, especially in the arts, publishing, and many science and engineering disciplines, especially for data visualization. Pascal also enjoyed a great deal of popularity due to its heritage in computer science education (when strong types and structured programming were still relatively new concepts in the 1970s through mid-1980s) and the low cost-of-entry for Turbo Pascal, UCSD p-System Pascal, etc.

If you're looking for another local Pi and Java enthusiast to help get things ported and/or tested, I'll volunteer and I can recruit others. During normal office hours, I can be in your facility in Santa Clara Thursdays except 2 ~ 6 PM. I'll otherwise be busy with tasks related to computing education for the start of the new school year at both high schools and universities through the postgraduate level, in addition to commercial software efforts, all of the above ranging as far away as Monterey. I can also contribute during nights and weekends in remote mode.

The best things in life aren't things ... but, a Pi comes pretty darned close! "Education is not the filling of a pail, but the lighting of a fire." -- W.B. YeatsIn theory, theory & practice are the same - in practice, they aren't!!!

I noticed that the file 'libjli.so' does come with the tarball, in the '/lib/arm/jli' folder, so a quick Google saw posts relating to the 'LD_LIBRARY_PATH' environment variable. So I tried that with an 'export' command but still did not work. I was assuming that a path to the 'lib' folder would do the trick but did not.

rbair wrote:mpthompson, I'd love for you to come down to the Oracle campus in Santa Clara if you have a chance and I'll show you what we've been working on and spend a little time investigating what could potentially be done in Raspbian in terms of configuration / libraries / performance. If nothing else it should be a lot of fun .

Hi Richard, I'm just getting caught up on things after a few days away. I certainly would be willing to come by for a visit and see what could be done on the Raspbian side to help accelerate a port of the Oracle Java VM. I don't see your Oracle email address around here. You can email me at mpthompson(at)gmail(dot)com and we can work out a time for a visit. I should be available pretty much the rest of this week.

Yes, I have just discovered that I can use Wheezy softfp from here http://www.raspberrypi.org/archives/1435 (2012-06-18-wheezy-beta.zip). I read that it is better than Squeeze. Now I am updating it (apt-get update, apt-get upgrade, rpi-update).

What about 2012-06-18-wheezy-beta.zip repositories? Will they be always up-to-date?

Thanks:)

Yes, that image is fine. A refreshed armel image should go on the download page soon, but there's no major updates (just newer firmware and misc accumulated changes).