歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux技術 >> Installing openjdk

Installing openjdk

日期:2017/3/3 12:39:06   编辑:Linux技術
[code]Ubuntu 16.04 LTS, sudo apt-cache search openjdk 時,搜索到的是 openjdk-8-jdk,
但是這個 openjdk-8-jdk 在編譯 Android Source Code時又報錯誤,因為Android Source Code
要求 1.7版本的 JDK,通過在 source.list 中添加 openjdk-7-jdk source的形式,能夠在 
sudo apt-cache search openjdk 時搜索到 openjdk-7-jdk,但是安裝時會報錯,各種依賴
關系得不到滿足。

在http://forum.ubuntu.org.cn/viewtopic.php?f=48&t=477645 中搜索到
的解決方案:
sudo add-apt-repository ppa:openjdk-r/ppa  
sudo apt-get update   
sudo apt-get install openjdk-7-jre

經過驗證,確實可以解決問題。

然後:
man add-apt-repository
NAME
       add-apt-repository - Adds a repository into the 
/etc/apt/sources.list or /etc/apt/sources.list.d or 
removes an existing one

SYNOPSIS
       add-apt-repository [OPTIONS] REPOSITORY

DESCRIPTION
       add-apt-repository is a script which adds an external 
APT repository to either /etc/apt/sources.list or a file in 
/etc/apt/sources.list.d/ or removes an already existing repository.
Copyright © Linux教程網 All Rights Reserved