简体   繁体   中英

Installing Oracle Java on Ubuntu

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

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM