Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am running Ubuntu 12.04 LTS. I wanted to install Java and so I downloaded the 32-bit self extracting .bin file from http://www.java.com and tried to install it according to their instruction.

First I made the file an executable one. Then created /usr/java/. After that I have to run this command: ./jre-7u<version>-linux-i586.bin.

But I'm stuck here. My Java version is Java 6 u32. When I enter the command it says "no such file or directory". What to do? Please help. Also I'm trying to install 32-bit Java on my 64-bit Precise. Could that possibly be the problem?

I tried to follow second answer by Jonas Christensen. I tried to open it, it says file is an unknown type. I tried the terminal command: ./jre-6u31-linux-i586.bin. But it gave this:

Unpacking...   
Checksumming...   
Extracting...   
./jre-6u32-linux-i586.bin: 86: ./jre-6u32-linux-i586.bin: ./install.sfx.5736: not found  
Failed to extract the files. Please refer to the Troubleshooting section of the Installation Instructions on the download page for more information.
share|improve this question
add comment

3 Answers

Please see the "bug" described at: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6500693

Resolve by installing 32 bit libs:

sudo apt-get install ia32-libs

share|improve this answer
    
On Ubuntu 13.10 , instead of ia32-libs, I installed lib32z1. –  kostmo Oct 21 '13 at 4:17
add comment

The easiest method to install Oracle Java 7 via PPA:

  1. sudo add-apt-repository ppa:webupd8team/java
  2. sudo apt-get update
  3. sudo apt-get install oracle-java7-installer


See also:

share|improve this answer
add comment

If you don't actually need a specific version of java for a special purpose, download the now-latest 7u7 version as a tar file: download 7u7 from java.com | download 6u35 from java.com.

Note that 6u35 link is a bin file as yours. But I have just tried to run it and it works. It is a generic shell script so to execute it: sh jre-6u35-linux-x64.bin. It wouldn't break anything that runs on 6u32, so download it with comfort.

Extract the archive and put contents to any directory you want (chosing a directory like /opt/java or /usr/local/java is ok. put it somewhere that you won't accidentally remove) and keep a note of the full path to that directory. Then edit as needed and put the following code into an executable .sh file inside /etc/profile.d:

#!/bin/bash
# You may put this in /etc/profile.d/java.sh

if [ -d <full-path-to-java> ]; then
  export PATH=$PATH:<full-path-to-java>;
fi

# dont forget to make executable, run following in your terminal:
# chmod +x /etc/profile.d/java.sh

As a little note, don't keep the '<' and '>' characters in :)

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.