코린이의 기록

[java] Install JAVA in Ubuntu 본문

JAVA

[java] Install JAVA in Ubuntu

코린이예요 2019. 6. 13. 17:04
반응형

1. Install

sudo apt-get install openjdk-8-jre
sudo apt-get install openjdk-8-jdk


2. Export Envirionment Variable

export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export PATH=$JAVA_HOME/bin:$PATH
export CLASS_PATH=$JAVA_HOME/lib:$CLASS_PATH
source /etc/profile


3. Check Version

java -version

openjdk version "1.8.0_212" 
OpenJDK Runtime Environment (build 1.8.0_212-8u212-b03-0ubuntu1.18.04.1-b03) 
OpenJDK 64-Bit Server VM (build 25.212-b03, mixed mode)

 

만약 전에 자바를 설치한적이 있고 Java 버전을 변경해야 한다면 아래 포스팅을 참고한다.

https://soye0n.tistory.com/24?category=764671

update-alternatives --config java 
There is only one alternative in link group java (providing /usr/bin/java): /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java

There is only one ~~ blah blah로 뜨면 다른 버전으로 바꿀 필요 없음.

 

 

 

반응형
Comments