Run a 32-bit JVM on 64-bit Linux ?

763 views
Skip to first unread message

Jan Goyvaerts

unread,
Feb 2, 2012, 4:26:01 AM2/2/12
to The Java Posse
Related to the last episode, I heard Dick telling he's running a 32-bit JVM on his - presumably - 64-bit Linux machine.

Last time I tried this the JDK installer simply wouldn't work. Or does it now ?

I'd very much like to try this because according to technical lecture the 32-bit JVM runs faster because it can cache twice as much references than its 64-bit equivalent. Meaning it will run faster. And consume less memory. This is especially true when creating huge object graphs. I'm going for the middle ground: -XX:+UseCompressedOops. The size of the references are smaller (never mind how they do that). And the memory consumption is indeed lower for huge amounts of live objects. It is said there's a performance price to pay though.

Casper Bang

unread,
Feb 2, 2012, 5:59:48 AM2/2/12
to java...@googlegroups.com
Installer? Just unpack the JDK and set the right paths (or update-alternative if using Debian derived distro):

> tar zxvf jdk-7u2-linux-i586.tar.gz
> jdk1.7.0_02/bin/java -version
java version "1.7.0_02"
Java(TM) SE Runtime Environment (build 1.7.0_02-b13)
Java HotSpot(TM) Server VM (build 22.0-b10, mixed mode)

Jan Goyvaerts

unread,
Feb 22, 2012, 6:07:06 AM2/22/12
to The Java Posse
That's right. But as soon as you run something with Swing you'll get
unsatisfied link errors:

java.lang.UnsatisfiedLinkError: /opt/javadev/jdk1.7.0_03_32b/jre/lib/
i386/xawt/libmawt.so: libXext.so.6: cannot open shared object file: No
such file or directory

Adding that to the library path: export LD_LIBRARY_PATH=/usr/lib/
x86_64-linux-gnu. But then it gives this error:

java.lang.UnsatisfiedLinkError: /opt/javadev/jdk1.7.0_03_32b/jre/lib/
i386/xawt/libmawt.so: libXext.so.6: wrong ELF class: ELFCLASS64

... is meant to run on a 64bit platform ?

On Feb 2, 11:59 am, Casper Bang <casper.b...@gmail.com> wrote:
> Installer? Just unpack the JDK and set the right paths (or
> update-alternative if using Debian derived distro):
>
> > wget
>
> http://download.oracle.com/otn-pub/java/jdk/7u2-b13/jdk-7u2-linux-i58...> tar zxvf jdk-7u2-linux-i586.tar.gz

Jan Goyvaerts

unread,
Feb 22, 2012, 6:30:59 AM2/22/12
to The Java Posse
Simply run the command to make it work : sudo apt-get install
ia-32libs.

Try to find a support center giving you an answer faster than these
guys: http://stackoverflow.com/questions/9393670/how-to-run-a-32bit-jvm-on-a-64bit-linux
;-)
Reply all
Reply to author
Forward
0 new messages