Java 8.45 安装问题

Java 8.45 安装问题

我尝试安装 java 8.45 wine,但安装甚至无法启动,因此我尝试下载旧版本并进行更新,但更新无法下载补丁。

有人知道该怎么处理它吗?

答案1

尝试这个方法

1.下载java

http://www.oracle.com/technetwork/java/javase/downloads/index.html

2.打开终端输入命令

cd Downloads

tar xzvf jdk-8u45-linux-x64.tar.gz

sudo mkdir /usr/lib/jvm

sudo mv ~/Downloads/jdk1.8.0_45/ /usr/lib/jvm/

sudo chown -R root:root /usr/lib/jvm/jdk1.8.0_45

sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.8.0_45/bin/java" 0

sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.8.0_45/bin/javac" 0

sudo update-alternatives --set java /usr/lib/jvm/jdk1.8.0_45/bin/java

sudo update-alternatives --set javac /usr/lib/jvm/jdk1.8.0_45/bin/javac

sudo gedit ~/.bashrc
    export JAVA_HOME=/usr/lib/jvm/jdk1.8.0_45
    export PATH=$PATH:$JAVA_HOME/bin

. ~/.bashrc

java -version

echo $JAVA_HOME

echo $PATH

相关内容