JAVA/ubuntu:修订间差异

来自康健生活
Kangkk​(留言 | 贡献)
Kangkk​(留言 | 贡献)
 
(未显示同一用户的4个中间版本)
第18行: 第18行:
# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).
export JAVA_HOME=/usr/lib/jvm/openjdk-14-jdk-headless
 
export JRE_HOME=$JAVA_HOME/jre
 
export CLASSPATH=$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH
 
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH
 


if [ "${PS1-}" ]; then
if [ "${PS1-}" ]; then
第29行: 第29行:
# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).
export JAVA_HOME=/usr/lib/jvm/openjdk-14-jdk-headless
export JRE_HOME=$JAVA_HOME/jre
export CLASSPATH=$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH


if [ "${PS1-}" ]; then
if [ "${PS1-}" ]; then
第35行: 第39行:


{{shc|<syntaxhighlight lang="bash">
{{shc|<syntaxhighlight lang="bash">
sudo source /etc/profile</syntaxhighlight>|$}}
source /etc/profile</syntaxhighlight>|$}}


== oracle ==
== oracle ==
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
[https://www.oracle.com/java/technologies/javase-downloads.html Java SE Downloads] 下载 JDK,或者直接去下载页面下载,如 [http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html Java SE Development Kit 8 Downloads]。
 
{{shc|<syntaxhighlight lang="bash">
tar -zxvf jdk-8u181-linux-x64.tar.gz
sudo mkdir /usr/java
sudo mv ./jdk1.8.0_181 /usr/java</syntaxhighlight>|$}}
 
=== 环境变量 ===
同上