学习了Java没多久,有一些基础概念有点犯迷惑。今天偶遇好文,摘录在此:

JDK (Java Development Kit)

Java Developer Kit contains tools needed to develop the Java programs, and JRE to run the programs. The tools include compiler (javac.exe), Java application launcher (java.exe), Appletviewer, etc…

Compiler converts java code into byte code. Java application launcher opens a JRE, loads the class, and invokes its main method.

You need JDK, if at all you want to write your own programs, and to compile the m. For running java programs, JRE is sufficient.

JRE is targeted for execution of Java files

i.e. JRE = JVM + Java Packages Classes(like util, math, lang, awt,swing etc)+runtime libraries.

JDK is mainly targeted for java development. I.e. You can create a Java file (with the help of Java packages), compile a Java file and run a java file

JRE (Java Runtime Environment)

Java Runtime Environment contains JVM, class libraries, and other supporting files. It does not contain any development tools such as compiler, debugger, etc. Actually JVM runs the program, and it uses the class libraries, and other supporting files provided in JRE. If you want to run any java program, you need to have JRE installed in the system

The Java Virtual Machine provides a platform-independent way of executing code; programmers can concentrate on writing software, without having to be concerned with how or where it will run.

If u just want to run applets (ex: Online Yahoo games or puzzles), JRE needs to be installed on the machine.

JVM (Java Virtual Machine)

As we all aware when we compile a Java file, output is not an 'exe' but it's a '.class' file. '.class' file consists of Java byte codes which are understandable by JVM. Java Virtual Machine interprets the byte code into the machine code depending upon the underlying operating system and hardware combination. It is responsible for all the things like garbage collection, array bounds checking, etc… JVM is platform dependent.

The JVM is called "virtual" because it provides a machine interface that does not depend on the underlying operating system and machine hardware architecture. This independence from hardware and operating system is a cornerstone of the write-once run-anywhere value of Java programs.

There are different JVM implementations are there. These may differ in things like performance, reliability, speed, etc. These implementations will differ in those areas where Java specification doesn’t mention how to implement the features, like how the garbage collection process works is JVM dependent, Java spec doesn’t define any specific way to do this.

Classpath

Classpath is nothing but setting up the environment for Java. Java will use to find compiled classes (i.e. .class files).

Path

PATH is nothing but setting up an environment for operating system. Operating System will look in this PATH for executables.

转载于:https://www.cnblogs.com/tedzhao/archive/2012/08/17/Java_Basic_Concept.html

Java中的一些基础概念相关推荐

  1. Java中的线程基础知识

    Java中的线程基础知识 1.线程概念 线程是程序运行的基本执行单元.当操作系统(不包括单线程的操作系统,如微软早期的DOS)在执行一个程序时,会在系统中建立一个进程,而在这个进程中,必须至少建立一个 ...

  2. 第90节:Java中的Linux基础

    第90节:Java中的Linux基础 linux是装载虚拟机上面的: JDK依赖包: yum install glibc.i686MYSQL依赖包: yum -y install libaio.so. ...

  3. java中的面向对象基础

    java中的面向对象基础 1.对象 #一切客观存在的事物都是对象,万物皆对象. #任何对象,一定具有自己的特征和行为. 2.类 (1)类的定义 (2)对象的创建 (3) 类与对象的关系 类:定义了对象 ...

  4. 第87节:Java中的Bootstrap基础与SQL入门

    第87节:Java中的Bootstrap基础与SQL入门 前言复习 什么是JQ? : write less do more 写更少的代码,做更多的事 找出所有兄弟: $("div" ...

  5. 并发王者课-铂金1:探本溯源-为何说Lock接口是Java中锁的基础

    欢迎来到<并发王者课>,本文是该系列文章中的第14篇. 在黄金系列中,我们介绍了并发中一些问题,比如死锁.活锁.线程饥饿等问题.在并发编程中,这些问题无疑都是需要解决的.所以,在铂金系列文 ...

  6. 铂金1:探本溯源-为何说Lock接口是Java中锁的基础

    欢迎来到<并发王者课>,本文是该系列文章中的第14篇. 在黄金系列中,我们介绍了并发中一些问题,比如死锁.活锁.线程饥饿等问题.在并发编程中,这些问题无疑都是需要解决的.所以,在铂金系列文 ...

  7. Java中的数组基本概念

    Java中的数组基本概念 一.一维数组 1.定义: 是多个相同类型数据按照一档顺序排列的集合,并用一个名字命名,并通过编号的方式对这些数据进行统一管理. 2.数组中有几个常见的概念: (1)数组名 ( ...

  8. Java中的线程基础篇-线程基本概念

    线程的概念.创建方式.生命周期.优缺点 一.基础知识 1. 进程.线程.协程 1.1 进程 1.2 线程 1.3 协程 2. 串行.并发.并行 2.1 串行 2.2 并发 2.3 并行 二.线程的创建 ...

  9. java 流的概念_举例讲解Java中的Stream流概念

    1.基本的输入流和输出流 流是 Java 中最重要的基本概念之一.文件读写.网络收发.进程通信,几乎所有需要输入输出的地方,都要用到流. 流是做什么用的呢?就是做输入输出用的.为什么输入输出要用&qu ...

最新文章

  1. 终于明白了 DevOps 与 SRE 的区别!
  2. git clone github_Git下载速度慢的解决方案汇总
  3. Java中四种访问修饰符的区别
  4. 算法竞赛入门经典(第二版) | 例题5-2 木块问题 (紫皮书牛啤!)(UVa101,The Blocks Problem)
  5. 需要在AndroidManifest中添加的条件
  6. 阿里云 磁盘脱机处理
  7. 如何利用第三方数据进行大数据分析
  8. iOS 架构模式--解密 MVC,MVP,MVVM以及VIPER架构
  9. CF 4B. Before an Exam
  10. Juniper MIP
  11. 程序员进阶之路的10本必读书目
  12. matlab 三维图形改变线宽,用PANDAS改变线宽绘制三维线图
  13. 强制浏览器使用webkit内核
  14. Android APP启动其他APP(一个APP拉起(跳转到)另一个APP)
  15. SQlserver基础学习
  16. ITUNES更改备份保存路径(不放C盘,不占C盘)
  17. 20220319编译OpenHarmony-v3.1-beta出错的解决方法
  18. 英雄萨姆二次出击全攻略
  19. 梁宁——用户体验地图和用户故事(阅读总结)
  20. Flash使用代码大全

热门文章

  1. 两列自适应布局方案整理
  2. 租用服务器怎么免去后顾之忧?
  3. spring +mybatis 事务不会滚
  4. C# Socket tcp 发送数据大小问题
  5. zookeeper核心面试问题及解答
  6. 编写更加稳定、可读性强的JavaScript代码
  7. ue4集合类型_UE4.22 Subsystem分析
  8. Javascript第七章cookie的读取和写入源码第一课
  9. vue 项目 upload上传图片 并实现拖拽排序
  10. mysql canal 安装测试_canal安装配置与mysql操作监听,我已经帮你踩过了所有的坑...