-
자바코드는 어떻게 실행되는가? <3>언어/자바 2023. 12. 18. 17:41
앞의 글에서 연결되는 글입니다.
실제로 JDK와 JRE는 어디에 어떤 형태로 있는지 확인해봅니다.
JDK와 JRE는 어디에 어떤 형태로 있을까?
현재 m1 맥을 사용하고 있고, brew를 통해서 자바를 install해서 사용하고 있다.
아래에 루트에 가면 자바의 버전별로 jdk가 설치 되어있는 것을 확인 할 수 있다.
(자바 8버전 jdk 폴더를 확인할 수 있다.)cd /Library/Java/JavaVirtualMachines
원하는 버전의 jdk 경로 속으로 들어가면
cd /Library/Java/JavaVirtualMachines/Contents/Home
bin 폴더에서 javac 실행파일을 찾을 수 있다.
우리가 javac를 실행시키면 이 위치의 javac 를 실행시키는 것이다.또
jre/lib 경로로 가면 나중에 만나볼 rt.jar파일도 찾아볼 수 있다.
rt.jar 대부분의 자바 표준 라이브러리가 포함되어 있는 파일 자바 애플리케이션 실행을 위해 필수 JVM에서 표준 자바클래스 라이브러리가 필요할 때 접근 자바9 버전부터는 rt.jar 제거되고 모듈 시스템 도입
'언어 > 자바' 카테고리의 다른 글
Queue의 add와 offer의 차이 (0) 2023.12.20 instanceof는 어떻게 작동하나? (0) 2023.12.20 동적바인딩과 @Override (0) 2023.12.20 자바코드는 어떻게 실행되는가? <2> (0) 2023.12.18 자바코드는 어떻게 실행되는가? <1> (0) 2023.12.18