在Debian 8上使用Apt-Get安装Java

安装Java的最简单方法是使用Debian打包的版本。具体来说,这将安装OpenJDK 8

先更新包索引命令:sudo apt-get update

搜索jdk8安装包

命令:apt-cache search java8

结果:

default-jdk - Standard Java or Java compatible Development Kit
default-jdk-headless - Standard Java or Java compatible Development Kit (headless)
default-jre - Standard Java or Java compatible Runtime
default-jre-headless - Standard Java or Java compatible Runtime (headless)
openjdk-8-jdk - OpenJDK Development Kit (JDK)
openjdk-8-jdk-headless - OpenJDK Development Kit (JDK) (headless)
openjdk-8-jre - OpenJDK Java runtime, using Hotspot JIT
openjdk-8-jre-headless - OpenJDK Java runtime, using Hotspot JIT (headless)
openjdk-11-jdk - OpenJDK Development Kit (JDK)
openjdk-11-jdk-headless - OpenJDK Development Kit (JDK) (headless)
openjdk-11-jre - OpenJDK Java runtime, using Hotspot JIT
openjdk-11-jre-headless - OpenJDK Java runtime, using Hotspot JIT (headless)

安装选定版本

我们这里选的是第一个:openjdk-8-jdk
安装命令:sudo apt-get install openjdk-8-jdk

你可能感兴趣的:(Linux,jdk,java)