언어
-
자바코드는 어떻게 실행되는가? <1>언어/자바 2023. 12. 18. 16:49
1. 자바 코드 실행시켜보기 일단 작성된 자바코드가 어떻게 실행되는지 살펴보겠습니다 우선 NewWorld.java 파일을 생성하고 NewWorld class를 만들었습니다 자바 코드를 실행시키려면 bytecode의 형태가 되어야하니까 컴파일러를 이용해서 bytecode를 만들어보겠습니다 javac NewWorld.java 명령어를 실행시키니, NewWorld.class 파일이 생성되었습니다 기계어 같은 모습일 것이라 생각했는데, 생각보다 기존 코드랑 크게 다르지 않은 것 같은 byte-code입니다. 이제 class 파일을 jvm에 넘겨주면 실행될 것이라고 생각했는데, 쉽게 되지 않습니다.. (파일의 확장자명을 빼고 실행시키니 작동하는군요.. java NewWorld ) 2. 자바 컴포넌트 그럼 이제 조..