2018年12月23日 星期日

Java in Linux

Q: How to identify JDK version?
A: For ex:
$ java -version
java version "1.7.0_181"
OpenJDK Runtime Environment (IcedTea 2.6.14) (7u181-2.6.14-0ubuntu0.3)
OpenJDK 64-Bit Server VM (build 24.181-b01, mixed mode)
(This is actually Java 1.7 = OpenJDK7 ~= OracleJDK7)
$ java -XshowSettings:properties -version

Q: How to install Java?
A:
$ sudo apt-get install default-jdk
# OpenJDK6
$ sudo apt-get install openjdk-6jdk
# OpenJDK7
$ sudo apt-get install openjdk-7jdk
# OracleJDK8
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
sudo apt-get install oracle-java8-set-default


沒有留言: