3

I have been trying to install Oracle Java 7 on Ubuntu 11.04. I was following the instructions given here

Once I followed all the steps ( to the letter ), I tried running

java -version

which gave the expected output. But running

javac -version

did not give the expected output. Instead I get the following error:

Error : Could not find libjava.so
Error : Could not find Java SE Runtime Environment

The environment variable PATH contains both /usr/local/java/jre/bin and /usr/local/java/jdk/bin, LD_LIBRARY_PATH points to /usr/local/lib which contains libjava.so which is currently owned by the user who I am running javac as. In addition, JAVA_HOME points to the jdk folder. Inspite of all this, javac is unable to find the libjava.so file. There are multiple solutions online but none seem to work for me. Even a direct run

/usr/locale/java/jdk/bin/javac -version

results in the same error.

Any help is hugely appreciated. Thanks

6
  • 2
    off topic here - try askubuntu.com maybe superuser.com Commented Dec 29, 2012 at 16:57
  • Possible duplicate: stackoverflow.com/questions/9701348/java-libjava-so-file-error Commented Dec 29, 2012 at 16:58
  • Not really. That talks of a 64-bit OS while I am on a 32-bit OS. Sorry for not mentioning that.After posting, I did find a duplicate question stackoverflow.com/questions/10759266/… but looks like even that has not been answered :( Commented Dec 29, 2012 at 17:04
  • Judging from the fact that the instructions that you mention apparently instruct the user to chmod +x a tarball, I would not be very surpised if they do not work... Commented Dec 29, 2012 at 18:38
  • Thanks for the comment. I tried installing using a different link and it worked. Adding the answer for future reference. Commented Dec 30, 2012 at 1:52

2 Answers 2

1

Oracle Java 1.7.0 from .deb packages

wget https://raw.github.com/flexiondotorg/oab-java6/master/oab-java.sh
chmod +x oab-java.sh
sudo ./oab-java.sh -7
sudo apt-get update
sudo sudo apt-get install oracle-java7-jdk oracle-java7-fonts oracle-java7-source 
sudo apt-get dist-upgrade

Workaround for 1.7.0_51

There is an Issue 123 currently in OAB and a pull request

Here is the patched vesion:

wget https://raw.github.com/ladios/oab-java6/master/oab-java.sh
chmod +x oab-java.sh
sudo ./oab-java.sh -7
sudo apt-get update
sudo sudo apt-get install oracle-java7-jdk oracle-java7-fonts oracle-java7-source 
sudo apt-get dist-upgrade
Sign up to request clarification or add additional context in comments.

Comments

0

It turns out that maybe the link had some errors. A better link to follow would be this

Hope that helps. The first answer on the page would be sufficient.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.