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

user1679030
  • 73
  • 2
  • 8
  • 2
    off topic here - try http://askubuntu.com/ maybe http://superuser.com/ – zapl Dec 29 '12 at 16:57
  • Possible duplicate: http://stackoverflow.com/questions/9701348/java-libjava-so-file-error – Adam Sznajder Dec 29 '12 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 http://stackoverflow.com/questions/10759266/error-running-javac-in-ubuntu-11-04?rq=1 but looks like even that has not been answered :( – user1679030 Dec 29 '12 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... – thkala Dec 29 '12 at 18:38
  • Thanks for the comment. I tried installing using a different link and it worked. Adding the answer for future reference. – user1679030 Dec 30 '12 at 01:52
  • possible duplicate of [Installing Java7 on Ubuntu](http://stackoverflow.com/questions/16263556/installing-java7-on-ubuntu) – Paweł Prażak Jan 24 '14 at 13:37

2 Answers2

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
Paweł Prażak
  • 3,091
  • 1
  • 27
  • 42
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.

Community
  • 1
  • 1
user1679030
  • 73
  • 2
  • 8