IT/JAVA

JDK 여러버전 사용 방법

@욕심쟁이 2024. 2. 29. 10:33
반응형

1. jdk 설치

오라클 사이트에서 원하는 버전을 다운로드(C:\Program Files\Java 위치에 jdk 설치)

 

https://www.oracle.com/java/technologies/downloads/

 

Download the Latest Java LTS Free

Subscribe to Java SE and get the most comprehensive Java support available, with 24/7 global access to the experts.

www.oracle.com

 

2. scripts 폴더 생성

3. bat 파일 생성(버전별로 생성 필요)

@echo off
set JAVA_HOME={JDK 주소}
set Path=%JAVA_HOME%\bin;%Path%
echo Java [version] activated.

4. 환경변수에 추가

JAVA_HOME : C:\Program Files\Java\script

5. cmd에서 동작 확인

반응형