它只是为了让它成为多平台吗?如果是这样,为什么我们不能只为不同的平台提供独立于平台的语言和不同的编译器?
解决方法
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.