René's URL Explorer Experiment


Title: [이호석] CH02 java Calculator 명령어는 어떻게 바이트코드를 어떻게 JVM에 적재할까? 간단하게 알아봅시다! · Issue #3 · Invincible-Backend-Study/java-basic · GitHub

Open Graph Title: [이호석] CH02 java Calculator 명령어는 어떻게 바이트코드를 어떻게 JVM에 적재할까? 간단하게 알아봅시다! · Issue #3 · Invincible-Backend-Study/java-basic

X Title: [이호석] CH02 java Calculator 명령어는 어떻게 바이트코드를 어떻게 JVM에 적재할까? 간단하게 알아봅시다! · Issue #3 · Invincible-Backend-Study/java-basic

Description: 🤔 왜 이슈를 생성했나요? 터미널 환경에서 자바 코드를 컴파일하고 실행하는 과정에서 어떻게 JVM까지 바이트 코드가 전달될까? 궁금증이 생겨 조사해봤습니다! 😁 공유하고 싶은 내용: java Calculator 명령어는 어떻게 바이트코드를 어떻게 JVM에 적재할까? 컴파일된 바이트 코드인 .class 파일을 확장자와 함께 실행하려고 하면 다음과 같은 예외가 발생합니다. 컴파일된 바이트 코드를 실행하기 위해서는 .class...

Open Graph Description: 🤔 왜 이슈를 생성했나요? 터미널 환경에서 자바 코드를 컴파일하고 실행하는 과정에서 어떻게 JVM까지 바이트 코드가 전달될까? 궁금증이 생겨 조사해봤습니다! 😁 공유하고 싶은 내용: java Calculator 명령어는 어떻게 바이트코드를 어떻게 JVM에 적재할까? 컴파일된 바이트 코드인 .class 파일을 확장자와 함께 실행하려고 하면 다음과 같은 ...

X Description: 🤔 왜 이슈를 생성했나요? 터미널 환경에서 자바 코드를 컴파일하고 실행하는 과정에서 어떻게 JVM까지 바이트 코드가 전달될까? 궁금증이 생겨 조사해봤습니다! 😁 공유하고 싶은 내용: java Calculator 명령어는 어떻게 바이트코드를 어떻게 JVM에 적재할까? 컴파일된 바이트 코드인 .class 파일을 확장자와 함께 실행하려고 하면 다음과 같은 ...

Opengraph URL: https://github.com/Invincible-Backend-Study/java-basic/issues/3

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[이호석] CH02 java Calculator 명령어는 어떻게 바이트코드를 어떻게 JVM에 적재할까? 간단하게 알아봅시다!","articleBody":"## 🤔 왜 이슈를 생성했나요?\r\n터미널 환경에서 자바 코드를 컴파일하고 실행하는 과정에서 어떻게 JVM까지 바이트 코드가 전달될까? 궁금증이 생겨 조사해봤습니다!\r\n\r\n\u003cbr\u003e\r\n\r\n## 😁 공유하고 싶은 내용: `java Calculator 명령어는 어떻게 바이트코드를 어떻게 JVM에 적재할까?`\r\n컴파일된 바이트 코드인 .class 파일을 확장자와 함께 실행하려고 하면 다음과 같은 예외가 발생합니다.\r\n컴파일된 바이트 코드를 실행하기 위해서는 .class 확장자를 생략해야 하기 때문입니다.\r\n\r\n```java\r\n\u003e java Calculator.class\r\n오류: 기본 클래스 Calculator.class을(를) 찾거나 로드할 수 없습니다. // (Exception in thread \"main\" java.lang.NoClassDefFoundError: HelloWorldApp/class)\r\n원인: java.lang.ClassNotFoundException: Calculator.class\r\n```\r\n\r\n\u003cbr\u003e\r\n\r\nOracle docs에서는 위와 같은 오류에 대해 다음과 같이 설명하고 있습니다.\r\n\r\n- **`Exception in thread \"main\" java.lang.NoClassDefFoundError: HelloWorldApp/class`**\r\n- A common mistake made by beginner programmers is to try and run the `java` launcher on the `.class` file that was created by the compiler. For example, you'll get this error if you try to run your program with `java HelloWorldApp.class` instead of `java HelloWorldApp`. Remember, the argument is the *name of the class* that you want to use, *not* the filename.\r\n```java\r\n초보 프로그래머가 흔히 저지르는 실수는 컴파일러가 생성한 .class 파일에서 자바 런처를 실행하는 것입니다. \r\n예를 들어, java HelloWorldApp 대신 java HelloWorldApp.class로 프로그램을 실행하려고 하면 이 오류가 발생합니다. \r\n인수는 파일 이름이 아니라 사용하려는 클래스의 이름이라는 점을 기억하세요.\r\n```\r\n- [출처 링크: Lesson: Common Problems (and Their Solutions) (The Java™ Tutorials \u003e Getting Started)](https://docs.oracle.com/javase/tutorial/getStarted/problems/index.html)\r\n\r\n\u003cbr\u003e\r\n\r\n\r\n즉, 바이트 코드를 실행시키기 위해서 파일 이름이 아니라 실행시키려는 클래스의 이름을 인수로 전달해야 합니다.\r\n그렇다면 어떻게 클래스를 JVM에 적재할 수 있을까요? \r\n\r\nJVM의 `Classloader`가 그 역할을 수행하고 있습니다. Classloader는 두 가지 방식의 클래스 로딩 방식을 지원 합니다.\r\n\r\n1. **로드타임 동적 로딩(Load-Time Dynamic Loading)**\r\n2. **런타임 동적 로딩(Run-TIme Dynamic Loading)**\r\n\r\n![image](https://user-images.githubusercontent.com/66772624/229743443-830fd869-9b09-4e3c-89c8-8a614efc74f2.png)\r\n`( 클래스 로더의 구조)`\r\n\r\n\u003cbr\u003e\r\n\r\n### 1. 로드 타입 동적 로딩\r\n\r\n`클래스 로더가 로드할때 동적으로 클래스가 로딩되는 경우`\r\n\r\n`java Calculator`와 같이 명령어로 계산기 클래스를 실행하게 되면 `로드타임 동적 로딩`이 실행되는데\r\n이때 Bootstrap ClassLoader가 실행되어 내부적으로 `Object` 클래스를 읽어 옵니다.(모든 클래스는 Object를 상속받기 때문에 먼저 불러오게 됩니다.)\r\n\r\n이후 Calculator 클래스를 로딩하기 위해 해당 클래스의 바이트 코드를 읽어옵니다.\r\n이때 내부적으로 사용되는 클래스들을 같이 로딩합니다. 만약 단순 Hello World 출력이라면 java.lang.String, java.lang.System과 같은 클래스들을 사용하므로 같이 로딩됩니다.\r\n\r\n\u003cbr\u003e\r\n\r\n### 2. 런타임 동적 로딩\r\n\r\n`실제 런타임 환경에서 이루어지는 동적 클래스 로딩`\r\n\r\n런타임 동적 로딩은 대표적으로 String[] args 인자를 생각해볼 수 있습니다.\r\n\r\n**`Class klass = Class.forName(args[0]);`** 다음과 같은 코드가 main()메소드에 포함되어 있다면 런타임 시점에서밖에 확인할 방법이 없습니다.\r\n\r\n따라서 실제 main() 메소드가 실행되다가 해당 라인을 만나게 되는경우에 args[0]이 어떤 클래스 인자인지 파악할 수 있습니다.\r\n\r\n\u003cbr\u003e\r\n\r\n### 참고\r\n\r\n\u003e **만약 .java가 붙은 텍스트 파일 이름과, 파일 내부에 선언된 클래스 명이 다르다면?** 이건 컴파일 단계에서 부터 오류를 뱉습니다.\r\n\u003e \r\n\u003e \r\n\u003e 결국 `.java 파일을 컴파일 하기 위해서는 내부에 선언된 클래스의 이름과 파일의 이름이 동일해야 합니다.`\r\n\u003e \r\n\u003e ![image](https://user-images.githubusercontent.com/66772624/229744168-910e39e8-ba7c-420c-acee-af4d80b60afb.png)\r\n\u003e \r\n\u003e **여러개의 클래스를 한 파일에서 선언한다면?**\r\n\u003e \r\n\u003e 이때는 public이 붙은 클래스의 이름은 반드시 파일의 이름과 동일해야 합니다. 그렇지 않으면 다음과 같은 컴파일 에러가 발생합니다!\r\n\u003e \r\n\u003e ![image](https://user-images.githubusercontent.com/66772624/229744250-c18a385a-1186-4833-bcab-3360ac8ceb77.png)\r\n\u003e \r\n\u003e ![image](https://user-images.githubusercontent.com/66772624/229744324-e18a649b-8185-4ef1-aa50-e05a7bf28756.png)\r\n\r\n\u003cbr\u003e\r\n\r\n## 조사하면서 아쉬운점\r\n클래스로더의 구조와 동작과정을 거의 겉핥기 수준으로 파악한 느낌이 강합니다 ㅎㅎ\r\n좀 더 공부해야겠지만 아직은 많이 어려운 내용이라.. 일단 이정도 수준에서 마무리 하고 더 공부해서 보충해보겠습니다!\r\n\r\n\u003cbr\u003e\r\n\r\n## 📌 참고자료, 공유하고 싶은 자료\r\n[Fundamental of JVM and Class Loader in java - Java JVM과 Class Loader의 동작 과정 이해](https://brewagebear.github.io/fundamental-jvm-classloader/)\r\n\r\n","author":{"url":"https://github.com/HiiWee","@type":"Person","name":"HiiWee"},"datePublished":"2023-04-04T09:13:32.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/3/java-basic/issues/3"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:ed6cadea-dbc1-8f93-bf5a-a42926c41563
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idE8EC:234FDE:D168CD:128A04D:697B8020
html-safe-nonce2d0e74b30ee69de8f2f949a76bf981fe3d9f6efc6f2601ce2dbdd3c44e70130e
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFOEVDOjIzNEZERTpEMTY4Q0Q6MTI4QTA0RDo2OTdCODAyMCIsInZpc2l0b3JfaWQiOiI0ODQzNDA0ODU3MzQ1NTQwMTI4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac1c7df790d5e63c2a5907b2cc56fdf7ec5002d703239ba741521d41322ff60394
hovercard-subject-tagissue:1653496160
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/Invincible-Backend-Study/java-basic/3/issue_layout
twitter:imagehttps://opengraph.githubassets.com/f1aeb0462da47c908ae85df80a0598b3b4060f8e19be783c1ae927638c862574/Invincible-Backend-Study/java-basic/issues/3
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/f1aeb0462da47c908ae85df80a0598b3b4060f8e19be783c1ae927638c862574/Invincible-Backend-Study/java-basic/issues/3
og:image:alt🤔 왜 이슈를 생성했나요? 터미널 환경에서 자바 코드를 컴파일하고 실행하는 과정에서 어떻게 JVM까지 바이트 코드가 전달될까? 궁금증이 생겨 조사해봤습니다! 😁 공유하고 싶은 내용: java Calculator 명령어는 어떻게 바이트코드를 어떻게 JVM에 적재할까? 컴파일된 바이트 코드인 .class 파일을 확장자와 함께 실행하려고 하면 다음과 같은 ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameHiiWee
hostnamegithub.com
expected-hostnamegithub.com
None26ef504c9f5eb2ac26b53c0437f934bbe4c0464979d7386917bd32d9fe70fc7a
turbo-cache-controlno-preview
go-importgithub.com/Invincible-Backend-Study/java-basic git https://github.com/Invincible-Backend-Study/java-basic.git
octolytics-dimension-user_id122281532
octolytics-dimension-user_loginInvincible-Backend-Study
octolytics-dimension-repository_id619187462
octolytics-dimension-repository_nwoInvincible-Backend-Study/java-basic
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id619187462
octolytics-dimension-repository_network_root_nwoInvincible-Backend-Study/java-basic
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasecea9b2b812b4d84ebc94c8a8bd97e2e99a2c0b48
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/Invincible-Backend-Study/java-basic/issues/3#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FInvincible-Backend-Study%2Fjava-basic%2Fissues%2F3
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FInvincible-Backend-Study%2Fjava-basic%2Fissues%2F3
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=Invincible-Backend-Study%2Fjava-basic
Reloadhttps://github.com/Invincible-Backend-Study/java-basic/issues/3
Reloadhttps://github.com/Invincible-Backend-Study/java-basic/issues/3
Reloadhttps://github.com/Invincible-Backend-Study/java-basic/issues/3
Invincible-Backend-Study https://github.com/Invincible-Backend-Study
java-basichttps://github.com/Invincible-Backend-Study/java-basic
Notifications https://github.com/login?return_to=%2FInvincible-Backend-Study%2Fjava-basic
Fork 5 https://github.com/login?return_to=%2FInvincible-Backend-Study%2Fjava-basic
Star 0 https://github.com/login?return_to=%2FInvincible-Backend-Study%2Fjava-basic
Code https://github.com/Invincible-Backend-Study/java-basic
Issues 4 https://github.com/Invincible-Backend-Study/java-basic/issues
Pull requests 2 https://github.com/Invincible-Backend-Study/java-basic/pulls
Actions https://github.com/Invincible-Backend-Study/java-basic/actions
Projects 0 https://github.com/Invincible-Backend-Study/java-basic/projects
Security 0 https://github.com/Invincible-Backend-Study/java-basic/security
Insights https://github.com/Invincible-Backend-Study/java-basic/pulse
Code https://github.com/Invincible-Backend-Study/java-basic
Issues https://github.com/Invincible-Backend-Study/java-basic/issues
Pull requests https://github.com/Invincible-Backend-Study/java-basic/pulls
Actions https://github.com/Invincible-Backend-Study/java-basic/actions
Projects https://github.com/Invincible-Backend-Study/java-basic/projects
Security https://github.com/Invincible-Backend-Study/java-basic/security
Insights https://github.com/Invincible-Backend-Study/java-basic/pulse
New issuehttps://github.com/login?return_to=https://github.com/Invincible-Backend-Study/java-basic/issues/3
New issuehttps://github.com/login?return_to=https://github.com/Invincible-Backend-Study/java-basic/issues/3
[이호석] CH02 java Calculator 명령어는 어떻게 바이트코드를 어떻게 JVM에 적재할까? 간단하게 알아봅시다!https://github.com/Invincible-Backend-Study/java-basic/issues/3#top
https://github.com/HiiWee
공유https://github.com/Invincible-Backend-Study/java-basic/issues?q=state%3Aopen%20label%3A%22%EA%B3%B5%EC%9C%A0%22
https://github.com/HiiWee
https://github.com/HiiWee
HiiWeehttps://github.com/HiiWee
on Apr 4, 2023https://github.com/Invincible-Backend-Study/java-basic/issues/3#issue-1653496160
출처 링크: Lesson: Common Problems (and Their Solutions) (The Java™ Tutorials > Getting Started)https://docs.oracle.com/javase/tutorial/getStarted/problems/index.html
https://user-images.githubusercontent.com/66772624/229743443-830fd869-9b09-4e3c-89c8-8a614efc74f2.png
https://user-images.githubusercontent.com/66772624/229744168-910e39e8-ba7c-420c-acee-af4d80b60afb.png
https://user-images.githubusercontent.com/66772624/229744250-c18a385a-1186-4833-bcab-3360ac8ceb77.png
https://user-images.githubusercontent.com/66772624/229744324-e18a649b-8185-4ef1-aa50-e05a7bf28756.png
Fundamental of JVM and Class Loader in java - Java JVM과 Class Loader의 동작 과정 이해https://brewagebear.github.io/fundamental-jvm-classloader/
HiiWeehttps://github.com/HiiWee
공유https://github.com/Invincible-Backend-Study/java-basic/issues?q=state%3Aopen%20label%3A%22%EA%B3%B5%EC%9C%A0%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.