JAVA/ubuntu:修订间差异

来自康健生活
Kangkk​(留言 | 贡献)
无编辑摘要
Kangkk​(留言 | 贡献)
第25行: 第25行:
if [ "${PS1-}" ]; then
if [ "${PS1-}" ]; then
   if [ "${BASH-}" ] && [ "$BASH" != "/bin/sh" ]; then
   if [ "${BASH-}" ] && [ "$BASH" != "/bin/sh" ]; then
</syntaxhighlight>|<syntaxhighlight lang="javascript">
</syntaxhighlight>
|<syntaxhighlight lang="javascript">
# /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), ...).
第35行: 第36行:
{{shc|<syntaxhighlight lang="bash">
{{shc|<syntaxhighlight lang="bash">
sudo source /etc/profile</syntaxhighlight>|$}}
sudo source /etc/profile</syntaxhighlight>|$}}
== oracle ==
== oracle ==
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

2020年6月10日 (三) 09:59的版本

引言

javac

kangkk@kangkk:~$
javac

Command 'javac' not found, but can be installed with:

sudo apt install default-jdk # version 2:1.11-72, or sudo apt install openjdk-11-jdk-headless # version 11.0.7+10-3ubuntu1 sudo apt install openjdk-13-jdk-headless # version 13.0.3+3-1ubuntu2 sudo apt install openjdk-14-jdk-headless # version 14.0.1+7-1ubuntu1 sudo apt install ecj # version 3.16.0-1

sudo apt install openjdk-8-jdk-headless # version 8u252-b09-1ubuntu1

环境变量

 
sudo vi /etc/profile
/etc/profile
# /etc/profile: system-wide .profile file for the Bourne shell (sh(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 [ "${BASH-}" ] && [ "$BASH" != "/bin/sh" ]; then
# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).

if [ "${PS1-}" ]; then
  if [ "${BASH-}" ] && [ "$BASH" != "/bin/sh" ]; then
 
sudo source /etc/profile

oracle

http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html