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

因为在国外上学所以锻炼一下自己的英文水平啦,用英文记录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?

       


          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

 


 

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.


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值