4

Ubuntu Server 14.04 LTS for Azure does not come with Java pre-installed.
The server architecture is AMD64.

I know that you cannot install both the x64 and x86 JREs side-by-side, and I only need the x86 version (application requirements, memory requirements, etc).

Both the x86 and x64 versions of OpenJDK-7-JRE are available directly from Ubuntu here:
http://packages.ubuntu.com/trusty/openjdk-7-jre
http://packages.ubuntu.com/trusty/i386/openjdk-7-jre/download

However, Ubuntu strongly recommends using a package manager (such as apt) to install the package, rather than downloading the binaries using a web-browser and manually copying to the destination machine.

Therefore, I've been trying to install from the command line, but I'm running into issues:

MyAdmin@Server01:~$ sudo apt-get install openjdk-7-jre:i386
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package openjdk-7-jre
MyAdmin@Server01:~$

The installation is successful if I omit the i386, but then I get the 64-bit JRE by default - which is not what I need.

I've confirmed that the source is already added in /etc/apt/sources.list

deb http://security.ubuntu.com/ubuntu trusty-security main
deb-src http://security.ubuntu.com/ubuntu trusty-security main
deb http://security.ubuntu.com/ubuntu trusty-security universe
deb-src http://security.ubuntu.com/ubuntu trusty-security universe
# deb http://security.ubuntu.com/ubuntu trusty-security multiverse
# deb-src http://security.ubuntu.com/ubuntu trusty-security multiverse

Is there another package, library, or repository that I need to install or update, before I can proceed with the apt installation of the OpenJDK x86 JRE?

3
  • 1
    Do you have ia32-lib installed? You need it for running 32-bit applications under a 64-bit system.
    – Alex R.
    Jul 29, 2014 at 19:06
  • @Alex R. Thanks for the tip - you pointed me in the right direction. However, I confirmed that it is unnecessary to install ia32-libs manually. But I did need to add the i386 architecture. See my answer below for details.
    – Giffyguy
    Jul 29, 2014 at 20:23
  • Perhaps you could add an explanation to your question of why you need a 32-bit java? Apr 5, 2016 at 22:08

1 Answer 1

10

It turns out I needed to explicitly add support for 32-bit architecture to the system.

openjdk-7-jre:i386 installed successfully after I did this:

sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install openjdk-7-jre:i386

NOTE: ia32-libs and any other necessary prerequisites are automatically selected and installed when you install openjdk-7-jre:i386. There's no need to install ia32-libs manually, and it's best to install the automatically selected libraries to ensure you definitely get the right version etc.

1
  • 1
    Nowadays you need sudo apt-get install openjdk-7-jre:i386. Jan 23, 2017 at 3:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .