반응형
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 |
Tags
- gradle
- 성신여대편백집
- react
- 한성대맛집
- 성신여대맛집
- 스페인여행
- 통영
- 한남동맛집
- ubuntu자바설치
- 꼴뚜기회
- 파이썬
- 통영여행
- 서울숲누룽지통닭구이
- 통영예쁜카페
- 국가직
- JavaScript
- 방이편백육분삼십성신여대
- springboot
- npm
- ELK
- 영화추천
- 뚝섬역맛집
- tomcat7
- 공무원
- 통영에어비앤비
- 퇴사후공무원
- 돈암동맛집
- 방이편백육분삼십
- 성북구맛집
- 자바스크립트에러처리
Archives
- Today
- Total
코린이의 기록
[Java] Java version 변경 본문
반응형
Java 버전 확인하기
1 2 3 4 5 6 7 8 9 10 | VirtualBox:/usr/lib/jvm$ java -version java version "1.8.0_151" Java(TM) SE Runtime Environment (build 1.8.0_151-b12) Java HotSpot(TM) 64-Bit Server VM (build 25.151-b12, mixed mode) VirtualBox:/usr/lib/jvm$ ls java-1.7.0-openjdk-amd64 java-7-openjdk-amd64 jre1.7.0_55 jre-7u55-linux-x64.tar.gz java-6-oracle java-8-oracle jre1.8.0_111 | cs |
바꾸고자하는 jdk를 다운로드한 후 아래와 같이 압축을 푼다.
1 | VirtualBox:/usr/lib/jvm$ tar -xvf jdo-7u80-linux-x84.tar.gz | cs |
update-alternatives 실행 (javac, java 둘다)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | VirtualBox:/usr/lib/jvm$ sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.7.0_80/bin/javac 1 VirtualBox:/usr/lib/jvm$ sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.7.0_80/bin/java 1 VirtualBox:/usr/lib/jvm$ sudo update-alternatives --config javac There are 3 choices for the alternative javac (providing /usr/bin/javac). Selection Path Priority Status ------------------------------------------------------------ 0 /usr/lib/jvm/java-8-oracle/bin/javac 1081 auto mode 1 /usr/lib/jvm/java-6-oracle/bin/javac 1 manual mode * 2 /usr/lib/jvm/java-8-oracle/bin/javac 1081 manual mode 3 /usr/lib/jvm/jdk1.7.0_80/bin/javac 1 manual mode Press enter to keep the current choice[*], or type selection number: 3 VirtualBox:/usr/lib/jvm$ sudo update-alternatives --config java There are 4 choices for the alternative java (providing /usr/bin/java). Selection Path Priority Status ------------------------------------------------------------ 0 /usr/lib/jvm/java-8-oracle/jre/bin/java 1081 auto mode 1 /usr/lib/jvm/java-6-oracle/jre/bin/java 1 manual mode 2 /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java 1071 manual mode * 3 /usr/lib/jvm/java-8-oracle/jre/bin/java 1081 manual mode 4 /usr/lib/jvm/jdk1.7.0_80/bin/java 1 manual mode Press enter to keep the current choice[*], or type selection number: 4 update-alternatives: using /usr/lib/jvm/jdk1.7.0_80/bin/java to provide /usr/bin/java (java) in manual mode VirtualBox:/usr/lib/jvm$ java -version java version "1.7.0_80" Java(TM) SE Runtime Environment (build 1.7.0_80-b15) Java HotSpot(TM) 64-Bit Server VM (build 24.80-b11, mixed mode) | cs |
sudo vi /etc/profile
아래 코드 추가
1 2 3 4 | JAVA_HOME=/usr/lib/jvm/jdk1.7.0_80 export JAVA_HOME PATH=$PATH:$JAVA_HOME/bin |
적용
1 | source /etc/profile | cs |
ec
반응형
'JAVA' 카테고리의 다른 글
[java] Install JAVA in Ubuntu (0) | 2019.06.13 |
---|---|
[Java] "jar: command not found" [Solved] (0) | 2019.04.15 |
[Java] Criteria API Subquery Expression (0) | 2019.03.07 |
[java] com.aliyun.openservices.iot.api.exception.IotClientException: client is already connected! (0) | 2019.03.04 |
[Java] RestTemplate Error : I/O error on PUT [Solved] (0) | 2018.12.14 |
Comments