因为在国外上学所以锻炼一下自己的英文水平啦,用英文记录Java 学习的过程。

 

  1. Java is Platform Independent.

It can be executed in multiple platforms(Windows,Linux or OSX), while a Windows C++ compiled file can be only executed inWindows.

 

  2.   How does Java compiler works?

       

Java学习笔记——JDK, JRE, JVM

          javac MyProgram.java                   java MyProgram.class

          

          javac (JavaProgramming Language Compiler)is a tool in JDK/bin to compile Java 

          source code intobytecode class files.

  

     3. JDK, JRE & JVM

 

Java学习笔记——JDK, JRE, JVM

 

JDK(Java Development Kit) is used to develop andit has four folders, bin, include, lib, jre.

  • bin: compiler (javac.exe) to compile .java into .class
  • include: head files between java and JVM
  • lib: libraries
  • jre: JRE

 

JVM(Java Virtual Machine) to execute .class files.The .class file is not executed directly in platforms but in virtual machinesprovided by JDK. Therefore, it can ignore the platform (OperatingSystems) differences.

 

JRE(Java Runtime Environment) has two folders, binand lib and they are different from above folders. When JVM interpret .classfiles, it has to call the needed libraries which JRE provides.

  • bin: JVM
  • lib: the necessary libraries for JVM

 

p.s. you can package .class file with jre folderto your friends and he can use it to run your program.


相关文章:

  • 2021-07-13
  • 2021-12-23
  • 2021-08-09
  • 2021-11-29
  • 2021-05-13
  • 2021-10-04
  • 2021-06-13
  • 2021-07-31
猜你喜欢
  • 2021-09-25
  • 2021-09-12
  • 2021-07-24
  • 2021-10-04
  • 2021-10-26
  • 2021-07-29
  • 2022-12-23
相关资源
相似解决方案