Info |
---|
This article is written for Java 1.7.x. For older versions read Zero Footprint Java 1.6.x on Ubuntu. |
Go to the Java website, choose the JRE or JDK based on your platform and needs. Download the requisite .tar.gz file and upload the file to the serveradmin home folder. For older versions of Java go to the Java Archives site.
Note |
---|
Originally, I had endorsed using 32-bit Java on 64-bit Ubuntu. Though I have not had a chance to do performance testing, with Cloud computing and lack of documention on 32-bit Java, it's time to move to 64-bit Java. |
Use the account that will be launching the Java process. In this example it will be serveradmin,
Code Block | ||
---|---|---|
| ||
su - serveradmin # If you are not already serveradmin cd ~ wget http://download.oracle.com/otn/java/jdk/7u7-b10/jre-7u7-linux-i586x64.tar.gz |
The steps for JRE and JDK are both the same. Here is an example of a JRE setup,
Note |
---|
Even on a 64-bit Operating System, 64-bit Java is should be reviewed at the moment (Nov 2012) due to significant loss in performance. |
If you try and install 32-bit Java on 64-bit Ubuntu you will get an error,
This is because the 32-bit library support is not installed,
For Ubuntu 13 and higher, multiarch has also been removed for direct dependencies,
... Tin to fill this out.... notes,
- sudo apt-get install package-name:i386 - http://askubuntu.com/questions/107230/what-happened-to-the-ia32-libs-package
- Discusses how to manually determine dependencies for package-name:i386 - http://askubuntu.com/questions/359156/how-do-you-run-a-32-bit-program-on-a-64-bit-version-of-ubuntu
- More discussions - http://stackoverflow.com/questions/9393670/how-to-run-a-32bit-jvm-on-a-64bit-linux
Reading above, somehow(I forget now), but somehow, I got to this and it works,
Code Block | ||
---|---|---|
| ||
sudo apt-get install libc6:i386 libgcc1:i386 gcc-4.6-base:i386 libstdc++5:i386 libstdc++6:i386 |
For Ubuntu 12 to 12.04, ia32-lib has been removed in favour of multiarch,
Code Block | ||
---|---|---|
| ||
sudo apt-get install ia32-libs-multiarch |
For Ubuntu 11 and lower,
Expand | |||||
---|---|---|---|---|---|
|
Now 32-bit Java can be installed,
Code Block | ||
---|---|---|
| ||
su - serveradmin # If you are not already serveradmin cd ~ # Switch to the serveradmin home directory tar -xvpf jre-7u7-linux-i586x64.tar.gz |
The result will be an uncompressed jre directory using the same name as the package. In this example the folder name would be, jre-7u7-linux-i586x64.
If you plan to use multiple versions of Java, we recommend keeping the folder name with the version number information and using symbolic links. If you are only using one version of Java, then simply rename the folder.
...
Code Block |
---|
mv jre-7u7-linux-i586x64 java |
Tip |
---|
You may be interested in how to Zero Footprint Java on Windows. |