有下列幾個方法,
1)一個是使用新的update source 在安裝oracle-java8-installer
$ echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" > /etc/apt/sources.list.d/webupd8team-java.list $ echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" >> /etc/apt/sources.list.d/webupd8team-java.list $ apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EEA14886 $ apt-get update $ apt-get install oracle-java8-installer
2)直接從oracle 網站捉取linux arm idk來用,記得選用arm32來安裝,我測試使用arm64都沒成功
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html, click the download button of Java Platform (JDK) 8. Click to Accept License Agreement, download jdk-8-linux-arm-vfp-hflt.tar.gz for Linux ARM v6/v7 Hard Float ABI. Log-in Raspberry Pi, enter the command to extract jdk-8-linux-arm-vfp-hflt.tar.gz to /opt directory. $ sudo tar zxvf jdk-8-linux-arm-vfp-hflt.tar.gz -C /opt Set default java and javac to the new installed jdk8. $ sudo update-alternatives --install /usr/bin/javac javac /opt/jdk1.8.0/bin/javac 1 $ sudo update-alternatives --install /usr/bin/java java /opt/jdk1.8.0/bin/java 1 $ sudo update-alternatives --config javac $ sudo update-alternatives --config java After all, verify with the commands with -verion option. $ java -version $ javac -version
沒有留言:
張貼留言