加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > Java > 正文

java – JVM存在的原因

发布时间:2020-12-14 19:34:21 所属栏目:Java 来源:网络整理
导读:我正在自学编程语言理论,我想知道为什么我们需要一个 Java虚拟机或任何虚拟机呢?根本原因是什么? 它只是为了让它成为多平台吗?如果是这样,为什么我们不能只为不同的平台提供独立于平台的语言和不同的编译器? 解决方法 在他们1996年的白皮书 The Java Lan
我正在自学编程语言理论,我想知道为什么我们需要一个 Java虚拟机或任何虚拟机呢?根本原因是什么?

它只是为了让它成为多平台吗?如果是这样,为什么我们不能只为不同的平台提供独立于平台的语言和不同的编译器?

解决方法

在他们1996年的白皮书 The Java Language Environment中,Sun的Java团队在Java语言中声明了以下 design goals:

The design requirements of the Java TM programming language are driven by the nature of the computing environments in which software must be deployed.

The massive growth of the Internet and the World-Wide Web leads us to a completely new way of looking at development and distribution of software. To live in the world of electronic commerce and distribution,Java technology must enable the development of secure,high performance,and highly robust applications on multiple platforms in heterogeneous,distributed networks.

Operating on multiple platforms in heterogeneous networks invalidates the traditional schemes of binary distribution,release,upgrade,patch,and so on. To survive in this jungle,the Java programming language must be architecture neutral,portable,and dynamically adaptable.

The system that emerged to meet these needs is simple,so it can be easily programmed by most developers; familiar,so that current developers can easily learn the Java programming language; object oriented,to take advantage of modern software development methodologies and to fit into distributed client-server applications; multithreaded,for high performance in applications that need to perform multiple concurrent activities,such as multimedia; and interpreted,for maximum portability and dynamic capabilities.

更进一步,他们更详细地解决了使用解释器的原因:

The Java interpreter can execute Java bytecodes directly on any machine to which the interpreter and run-time system have been ported. In an interpreted platform such as Java technology-based system,the link phase of a program is simple,incremental,and lightweight. You benefit from much faster development cycles–prototyping,experimentation,and rapid development are the normal case,versus the traditional heavyweight compile,link,and test cycles.

While the Java Compiler is strict in its compile-time static checking,the language and run-time system are dynamic in their linking stages. Classes are linked only as needed. New code modules can be linked in on demand from a variety of sources,even from sources across a network. In the case of the HotJava Browser and similar applications,interactive executable code can be loaded from anywhere,which enables transparent updating of applications. The result is on-line services that constantly evolve; they can remain innovative and fresh,draw more customers,and spur the growth of electronic commerce on the Internet.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读