简体   繁体   English

在Ubuntu上安装Oracle Java

[英]Installing Oracle Java on Ubuntu

I have been trying to install Oracle Java 7 on Ubuntu 11.04. 我一直在尝试在Ubuntu 11.04上安装Oracle Java 7。 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. 环境变量PATH包含/ usr / local / java / jre / bin和/ usr / local / java / jdk / bin,LD_LIBRARY_PATH指向/ usr / local / lib,其中包含目前由用户拥有的libjava.so。我正在运行javac。 In addition, JAVA_HOME points to the jdk folder. 另外,JAVA_HOME指向jdk文件夹。 Inspite of all this, javac is unable to find the libjava.so file. 尽管如此,javac仍无法找到libjava.so文件。 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 来自.deb包的Oracle Java 1.7.0

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 1.7.0_51的解决方法

There is an Issue 123 currently in OAB and a pull request 目前在OAB中有一个问题123和一个拉取请求

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. 页面上的第一个答案就足够了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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