Program Tip

JDK와 JRE의 차이점은 무엇입니까?

programtip 2020. 9. 28. 09:56
반응형

JDK와 JRE의 차이점은 무엇입니까?


JDK와 JRE의 차이점은 무엇입니까?

그들의 역할은 무엇이며 언제 둘 중 하나를 사용해야합니까?


JRE는 은 IS 자바 런타임 환경 . Java Virtual Machine (JVM), Java Class Library, java명령 및 기타 인프라를 포함하여 컴파일 된 Java 프로그램을 실행하는 데 필요한 모든 패키지입니다 . 그러나 새 프로그램을 만드는 데는 사용할 수 없습니다.

JDK는 은 IS 자바 개발 키트 , 자바의 모든 기능을 갖춘 SDK. JRE에있는 모든 것뿐만 아니라 컴파일러 ( javac)와 도구 ( javadocjdb)도 있습니다. 프로그램을 만들고 컴파일 할 수 있습니다.

일반적으로 컴퓨터에서 Java 프로그램을 실행하는 데만 관심이 있다면 JRE 만 설치합니다. 필요한 전부입니다. 반면에 Java 프로그래밍을 할 계획이라면 대신 JDK를 설치해야합니다.

컴퓨터에서 Java 개발을 수행 할 계획이 없더라도 JDK를 설치해야하는 경우가 있습니다. 예를 들어, JSP를 사용하여 웹 애플리케이션을 배포하는 경우 기술적으로 애플리케이션 서버 내에서 Java 프로그램을 실행하는 것입니다. 그렇다면 왜 JDK가 필요합니까? 애플리케이션 서버가 JSP를 Java 서블릿으로 변환하고 서블릿을 컴파일하기 위해 JDK를 사용해야하기 때문입니다. 더 많은 예가 있다고 확신합니다.


위의 답변 (파블로)은 매우 옳습니다. 이것은 단지 추가 정보입니다.

JRE는 이름,에서 알 수 있듯이, 인 환경을 . 기본적으로 Java 관련 파일이있는 디렉토리입니다.

  • bin/Java의 실행 프로그램이 포함되어 있습니다. 가장 중요한 것은 JVM을 시작하는 java(그리고 Windows의 경우 javaw도)입니다. 같은뿐만 아니라 여기에 몇 가지 다른 유틸리티있다 keytoolpolicytool.
  • conf/ Java 전문가가 사용할 수 있도록 사용자가 편집 할 수있는 구성 파일을 보유하고 있습니다.
  • lib/많은 지원 파일이 있습니다 : 일부 .jars, 구성 파일, 속성 파일, 글꼴, 번역, 인증서 등-Java의 모든 "트리밍". 가장 중요한 것은 Java 표준 라이브러리의 modules파일을 포함하는 .class파일입니다.
  • 특정 수준에서 Java 표준 라이브러리는 네이티브 코드를 호출해야합니다. 이를 위해 JRE에는 시스템 별 네이티브 바이너리 코드를 지원 하거나 지원하는 일부 .dll(Windows) 또는 .dylib(macOS) 또는 .so(Linux) 파일이 포함되어 있습니다.bin/lib/

JDK는 또한 디렉토리의 집합입니다. 다음과 같은 몇 가지 추가 사항이있는 JRE의 상위 집합입니다.

  • bin/개발 도구로 확장되었습니다. 그들 중 가장 중요한 것은 javac; 기타에는 jar, javadocjshell.
  • jmods/, 표준 라이브러리 용 JMOD 파일이 추가되었습니다. 이러한 파일을 사용하면 표준 라이브러리를 jlink.

여기에 이미지 설명 입력

JDK는 JRE의 상위 집합이며 JRE에있는 모든 항목과 애플릿 및 애플리케이션 개발에 필요한 컴파일러 및 디버거와 같은 도구를 포함합니다. JRE는 Java 프로그래밍 언어로 작성된 애플릿 및 응용 프로그램을 실행하기위한 라이브러리, JVM (Java Virtual Machine) 및 기타 구성 요소를 제공합니다.


평범한 용어로 : JDK는 할아버지입니다. JRE는 아버지이고 JVM은 그들의 아들입니다. [예 : JDK> JRE> JVM]

JDK = JRE + 개발 / 디버깅 도구

JRE = JVM + Java 패키지 클래스 (예 : util, math, lang, awt, swing 등) + 런타임 라이브러리.

JVM = 클래스 로더 시스템 + 런타임 데이터 영역 + 실행 엔진.

즉, Java 프로그래머 인 경우 시스템에 JDK가 필요하며이 패키지에는 JRE와 JVM도 포함되지만 온라인 게임을 즐기는 일반 사용자 인 경우 JRE 만 필요하며이 패키지에는 그것에 JDK.

JVM :

JVM (Java Virtual Machine)은 Java 바이트 코드를 실행하는 가상 머신입니다. JVM은 Java 소스 코드를 이해하지 못하므로 * .java 파일을 컴파일하여 JVM에서 이해할 수있는 바이트 코드가 포함 된 * .class 파일을 얻습니다. 또한 Java가 "이동 가능한 언어"(한 번 작성하면 어디에서나 실행)가 될 수있는 엔티티이기도합니다. 실제로 다른 시스템 (Windows, Linux, MacOS, 위키 백과 목록 참조)에 대한 JVM의 특정 구현이 있습니다. 목표는 동일한 바이트 코드를 사용하여 모두 동일한 결과를 제공하는 것입니다.

JDK 및 JRE

JDK와 JRE의 차이점을 설명하려면 Oracle 설명서를 읽고 다이어그램을 참조하는 것이 가장 좋습니다.

자바 런타임 환경 (JRE)

JRE (Java Runtime Environment)는 Java 프로그래밍 언어로 작성된 애플릿과 응용 프로그램을 실행하기위한 라이브러리, Java Virtual Machine 및 기타 구성 요소를 제공합니다. 또한 두 가지 주요 배포 기술이 JRE의 일부입니다. Java Plug-in은 애플릿이 널리 사용되는 브라우저에서 실행되도록합니다. 네트워크를 통해 독립 실행 형 응용 프로그램을 배포하는 Java Web Start. 또한 엔터프라이즈 소프트웨어 개발 및 배포를위한 J2EE (Java 2 Platform, Enterprise Edition) 기술의 기반이기도합니다. JRE에는 애플릿 및 애플리케이션 개발을위한 컴파일러 또는 디버거와 같은 도구 및 유틸리티가 포함되어 있지 않습니다.

자바 개발 키트 (JDK)

JDK는 JRE의 상위 집합이며 JRE에있는 모든 항목과 애플릿 및 응용 프로그램 개발에 필요한 컴파일러 및 디버거와 같은 도구를 포함합니다.

Oracle만이 JDK를 제공하는 것은 아닙니다.

JIT 컴파일 프로세스 (제공 : Oracle 문서)

JDK> JRE> JVM


공식 자바 웹 사이트에서 ...

JRE (Java 런타임 환경) :

  • 실제로 Java 프로그램을 실행하는 Java Virtual Machine *의 구현입니다.
  • Java Runtime Environment는 Java 프로그램을 실행하는 데 필요한 플러그인입니다.
  • JRE는 JDK보다 작으므로 디스크 공간이 더 적게 필요합니다.
  • JRE는 https://www.java.com 에서 무료로 다운로드 / 지원할 수 있습니다.
  • 여기에는 Java로 작성된 애플리케이션 및 애플릿을 실행하기위한 JVM, Core 라이브러리 및 기타 추가 구성 요소가 포함됩니다.

JDK (자바 개발 키트)

  • Java 기반 애플리케이션을 개발하는 데 사용할 수있는 소프트웨어 번들입니다.
  • Java 애플리케이션을 개발하려면 Java Development Kit가 필요합니다.
  • JDK에는 다양한 개발 도구와 함께 JRE가 포함되어 있으므로 더 많은 디스크 공간이 필요합니다.
  • JDK는 https://www.oracle.com/technetwork/java/javase/downloads/ 에서 무료로 다운로드 / 지원할 수 있습니다.
  • 여기에는 JRE, API 클래스 세트, Java 컴파일러, Webstart 및 Java 애플릿 및 응용 프로그램을 작성하는 데 필요한 추가 파일이 포함됩니다.

디버깅 관점에서 한 가지 차이점은 다음과 같습니다.

String 및 ArrayList와 같은 Java 시스템 클래스로 디버그하려면 "디버그 정보"로 컴파일 된 특수 버전의 JRE가 필요합니다. JDK에 포함 된 JRE는이 정보를 제공하지만 일반 JRE는 제공하지 않습니다. 일반 JRE는 더 나은 성능을 보장하기 위해이 정보를 포함하지 않습니다.

디버깅 정보 란 무엇입니까? 다음은 이 블로그 게시물 에서 가져온 간단한 설명입니다 .

현대의 컴파일러는 멋지게 들여 쓰기 및 중첩 된 제어 구조와 임의로 입력 된 변수를 기계 코드 (또는 Java의 경우 바이트 코드)라고하는 큰 비트 더미로 높은 수준의 코드를 변환하는 데 매우 효과적입니다. 대상 CPU (JVM의 가상 CPU)에서 최대한 빠르게 실행합니다. Java 코드는 여러 기계 코드 명령어로 변환됩니다. 변수는 스택, 레지스터 또는 완전히 최적화 된 곳에서 모든 곳으로 밀려납니다. 구조와 객체는 결과 코드에도 존재하지 않습니다. 단지 하드 코딩 된 오프셋으로 메모리 버퍼로 변환되는 추상화 일뿐입니다.

So how does a debugger know where to stop when you ask it to break at the entry to some function? How does it manage to find what to show you when you ask it for the value of a variable? The answer is – debugging information.

Debugging information is generated by the compiler together with the machine code. It is a representation of the relationship between the executable program and the original source code. This information is encoded into a pre-defined format and stored alongside the machine code. Many such formats were invented over the years for different platforms and executable files.


JRE

JRE is an acronym for Java Runtime Environment.It is used to provide runtime environment.It is the implementation of JVM.It physically exists.It contains set of libraries + other files that JVM uses at runtime.

JDK

JDK is an acronym for Java Development Kit.It physically exists.It contains JRE + development tools.

Link :- http://www.javatpoint.com/difference-between-jdk-jre-and-jvm

Usually, when you only care about running Java programs on your browser or computer you will only install JRE. It's all you need. On the other hand, if you are planning to do some Java programming, you will also need JDK.


JVM, JRE and JDK are platform dependent because configuration of each OS differs. But, Java is platform independent.

Java Virtual Machine (JVM) is a run-time system that executes Java bytecode.

JRE is the environment (standard libraries and JVM) required to run Java applications.

The JDK includes the JRE plus command-line development tools such as compilers and debuggers that are necessary or useful for developing applets and applications.


Here's a simple response directly from Oracle http://docs.oracle.com/javase/7/docs/technotes/guides/

Java SE Runtime Environment (JRE)

The JRE provides the libraries, Java virtual machine, and other components necessary for you to run applets and applications written in the Java programming language. This runtime environment can be redistributed with applications to make them free-standing.

Java SE Development Kit (JDK)

The JDK includes the JRE plus command-line development tools such as compilers and debuggers that are necessary or useful for developing applets and applications.


If you want to run Java programs, but not develop them, download the Java Run-time Environment, or JRE. If you want to develop them, download the Java Development kit, or JDK

JDK

Let's called JDK is a kit, which include what are those things need to developed and run java applications.

JDK is given as development environment for building applications, component s and applets.

JRE

It contains everything you need to run Java applications in compiled form. You don't need any libraries and other stuffs. All things you need are compiled.

JRE is can not used for development, only used for run the applications.


JVM, JRE, JDK - these are all the backbone of Java language. Each components work separately . Jdk and Jre physically exists but Jvm is an abstract machine that means it does not physically exist.

JVM is the subsystem of JDK and JRE which is used to check the intermediate code known as Bytecode. It first loads "class file" having .c extension generated by the Java compiler (Javac) through JVM subsystem classloader and classified memory location (class area, stack, heap and pc registers) according to their use. Then it checks all the Bytecode to ensure that it is returned in java and all memory accessibility access by the network. After that interpreter's work starts, the interpreter checks the whole program line by line and finally the results are shown in the console, browser and application through JRE (Java Runtime Environment) which runtime facilities.

JRE is also a subsystem of JDK which provides runtime facilities like JVM, classes, executable file like .jar file etc.

JDK stands Java Development Kit it contain all necessary components which used in programming like class, methods, swing, AWT, package, java (interpretor), javac (compiler), appletviewer(applet application viewer) etc. So final conclusion is it content every file which useful in developing an application weather it standalone or web based.


JVM (Java Virtual Machine) is an abstract machine. It is a specification that provides runtime environment in which java bytecode can be executed.

JRE is an acronym for Java Runtime Environment.It is used to provide runtime environment.It is the implementation of JVM.It physically exists.It contains set of libraries + other files that JVM uses at runtime

JDK is an acronym for Java Development Kit.It physically exists.It contains JRE + development tools


If you are a Java programmer you will need JDK in your system and this package will include JRE and JVM as well but if you are normal user who like to play online games then you will only need JRE and this package will not have JDK in it.

JVM

JVM (Java Virtual Machine) is an abstract machine. It is a specification that provides runtime environment in which java bytecode can be executed.

JVMs are available for many hardware and software platforms. JVM, JRE and JDK are platform dependent because configuration of each OS differs. But, Java is platform independent.

JRE

It contains everything you need to run Java applications in compiled form. You don't need any libraries and other stuffs. All things you need are compiled.

JRE is can not used for development, only used for run the applications.

Java SE Development Kit (JDK)

The JDK includes the JRE plus command-line development tools such as compilers and debuggers that are necessary or useful for developing applets and applications.

(Sources: GeeksForGeeks Q&A, Java Platform Overview)


A clear understanding of these terms(JVM, JDK, JRE) are essential to grasp their usage and differences.

JVM Java Virtual Machine (JVM) is a run-time system that executes Java bytecode. The JVM is like a virtual computer that can execute a set of compiled instructions and manipulate memory locations. When a Java compiler compiles source code, it generates a highly optimized set of instructions called bytecode in a .class file. The JVM interprets these bytecode instructions and converts them to machine-specific code for execution.

JDK The Java Development Kit (JDK) is a software development environment that you can use to develop and execute Java applications. It includes the JRE and a set of programming tools, such as a Java compiler, interpreter, appletviewer, and document viewer. The JDK is implemented through the Java SE, Java EE, or Java ME platforms.

JRE The Java Runtime Environment (JRE) is a part of the JDK that includes a JVM, core classes, and several libraries that support application development. Though the JRE is available as part of the JDK, you can also download and use it separately.

For complete understanding you can see my Blog : Jdk Jre Jvm and differences


jdk is necessary to compile to code and convert java code to byte codes while jre is necessary for executing the byte codes.


JDK includes the JRE plus command-line development tools such as compilers and debuggers that are necessary or useful for developing applets and applications.

JRE is basically the Java Virtual Machine where your Java programs run on. It also includes browser plugins for Applet execution.

JDK is an abstract machine. It is a specification that provides runtime environment in which java bytecode can be executed.

So, Basically JVM < JRE < JDK as per @Jaimin Patel said.


Simply :

JVM is the virtual machine Java code executes on

JRE is the environment (standard libraries and JVM) required to run Java applications

JDK is the JRE with developer tools and documentation


The difference between JDK and JRE is that JDK is the software development kit for java while JRE is the place where you run your programs.


suppose, if you are a developer then your role is to develop program as well as to execute the program. so you must have environment for developing and executing, which is provided by JDK.

suppose, if you are a client then you don't have to worry about developing.Just you need is, an environment to run program and get result only, which is provided by JRE.

JRE executes the application but JVM reads the instructions line by line so it's interpreter.

JDK=JRE+Development Tools

JRE=JVM+Library Classes


JRE

JRE is an acronym for Java Runtime Environment.It is used to provide runtime environment.It is the implementation of JVM. It physically exists. It contains set of libraries + other files that JVM uses at runtime.

Implementation of JVMs are also actively released by other companies besides Sun Micro Systems.

여기에 이미지 설명 입력

JDK

JDK is an acronym for Java Development Kit.It physically exists.It contains JRE + development tools.

여기에 이미지 설명 입력

참고URL : https://stackoverflow.com/questions/1906445/what-is-the-difference-between-jdk-and-jre

반응형