Install Java 32bit Version on Linux

I just struggled with installing a 32 bit version of Java JDK on my 64 bit ubuntu machine.

After installing the JDK-Files (download the .tar.gz archive and un-tar it),

you will have to add it to java alternatives, so it will be recognized by the OS:

sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.7.0_21/bin/java 90

Note: I have put the files to “/usr/lib/jvm” .

This will add the new files to the alternatives list.

Now you have to tell ubuntu to use it by default:

sudo update-alternatives --config java

Choose the java version you want to use here.

 

If running “java -jar File.jar” does not work,

use “java -d32  -jar File.jar” to tell java to use 32 bit, if your selected JRE supports 32 and 64bit operation.

 

 

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: