vaughanb
Posts: 3
Joined: Mon Aug 19, 2013 3:13 pm

Oracle JRockit on Debian Wheezy

Mon Aug 19, 2013 3:34 pm

Hi,

I am still new to the Raspberry Pi. At the moment I am busy with a project involving the Soft Float version of Debian Wheezy and for this project JRockit has been chosen as the Java Virtual Machine in which to run our Java applications. However when attempting to install the JRockit .bin file I get the error message "cannot execute binary file"

Does anybody know what could be causing this error?

Thanks

Vaughan

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

Re: Oracle JRockit on Debian Wheezy

Mon Aug 19, 2013 8:26 pm

vaughanb wrote:Hi,

I am still new to the Raspberry Pi. At the moment I am busy with a project involving the Soft Float version of Debian Wheezy and for this project JRockit has been chosen as the Java Virtual Machine in which to run our Java applications. However when attempting to install the JRockit .bin file I get the error message "cannot execute binary file"

Does anybody know what could be causing this error?

Thanks

Vaughan
JRockit is only designed to be installed on Linux systems running on CPU using the x86 32bit & 64bit instruction-set.

The Raspberry Pi uses Linux with ARM v6 instruction-set.

You get the "cannot execute binary file" error if you try to run a x86 ABI binary file OR a hard-float ABI ARM binary file on a soft-float ABI ARM system. The "application binary interface" ABI do not match.

I do not think there is any version of JRockit that work on the Raspberry Pi unless you decide to run it inside an emulator.


If you do happen to own a ARM v6 version of JRockit then read blow:
You can also get a "cannot execute binary file" if the binary file is not marked as executable.

You may make the filename.bin to be marked executable by running:
chmod +x filename.bin


general advice:
find out more about the the_binary_file.bin using some tools found on your pi system, try running:
# file tells what kind of file it is
file the_binary_file.bin

# ldd checks if the file can load all shared libraries
ldd the_binary_file.bin

# readelf can list the ABI in use by examine the ELF header.
readelf -h the_binary_file.bin
Xerxes Rånby @xranby I once had two, then I gave one away. Now both are in use every day!
twitter.com/xranby

vaughanb
Posts: 3
Joined: Mon Aug 19, 2013 3:13 pm

Re: Oracle JRockit on Debian Wheezy

Mon Aug 19, 2013 9:10 pm

Thank you for your reply. If I did run it in an emulator, would I still have access to the GPIOs (via Java)?
Would you also be able to suggest some lightweight emulators which would be suitable?

Thanks in advance

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

Re: Oracle JRockit on Debian Wheezy

Mon Aug 19, 2013 9:40 pm

vaughanb wrote:Thank you for your reply. If I did run it in an emulator, would I still have access to the GPIOs (via Java)?
Would you also be able to suggest some lightweight emulators which would be suitable?

Thanks in advance
There is no lightweight emulators, you can try for academic purposes to use qemu-user that may let you run a statically compiled x86 Linux binary on a ARM Linux system.

What I do recommend is to use a Java runtime designed and compiled for the ARM instruction-set, and switch to the hard-float ABI.
This will be the fastest, most easy to setup and the most stable option. take a look at the status of java on raspbian page:
http://www.raspberrypi.org/phpBB3/viewt ... 81&t=27805 This forum thread list many Java JRE and JDK options that work well with the hard-float ABI on the Pi.

Use the third party Pi4J library to access the GPIO's on the Pi. Pi4J work with both soft-float and hard-float ARM Linux Java runtime systems.
http://pi4j.com/example/control.html - Simple GPIO Control using Pi4J.
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 “Debian”