Documentation

The Java™ Tutorials
Hide TOC
About the Java Technology关于Java技术
Trail: Getting Started
Lesson: The Java Technology Phenomenon

About the Java Technology关于Java技术

Java technology is both a programming language and a platform.Java技术既是一种编程语言,也是一种平台。

The Java Programming LanguageJava编程语言

The Java programming language is a high-level language that can be characterized by all of the following buzzwords:Java编程语言是一种高级语言,其特点是具有以下所有流行语:

  • Simple简单的
  • Object oriented面向对象的
  • Distributed分布式的
  • Multithreaded多线程的
  • Dynamic动态的
  • Architecture neutral架构中立的
  • Portable便携的
  • High performance高性能的
  • Robust强健的
  • Secure安全的

Each of the preceding buzzwords is explained in The Java Language Environment , a white paper written by James Gosling and Henry McGilton.前面的每一个流行语都在《Java语言环境》中进行了解释,它是由James Gosling和Henry McGilton撰写的白皮书。

In the Java programming language, all source code is first written in plain text files ending with the .java extension.在Java编程语言中,所有源代码首先都是以.java扩展名结尾的纯文本文件编写的。Those source files are then compiled into .class files by the javac compiler.这些源文件然后由javac编译器编译成.class文件。A .class file does not contain code that is native to your processor; it instead contains bytecodes — the machine language of the Java Virtual Machine1 (Java VM)..class文件不包含处理器本机代码;而是包含字节码—Java虚拟机1(Java VM)的机器语言。The java launcher tool then runs your application with an instance of the Java Virtual Machine.java启动工具然后使用Java虚拟机的实例运行应用程序。

Figure showing MyProgram.java, compiler, MyProgram.class, Java VM, and My Program running on a computer.

An overview of the software development process.软件开发过程概述。

Because the Java VM is available on many different operating systems, the same .class files are capable of running on Microsoft Windows, the Solaris™ Operating System (Solaris OS), Linux, or Mac OS.由于Java VM可在许多不同的操作系统上使用,因此相同的.class文件可以在Microsoft Windows、Solaris™操作系统(Solaris操作系统)、Linux或Mac操作系统上运行。Some virtual machines, such as the Java SE HotSpot at a Glance, perform additional steps at runtime to give your application a performance boost.一些虚拟机,譬如JavaSE热点一目了然,在运行时执行额外的步骤来提高应用程序的性能。This includes various tasks such as finding performance bottlenecks and recompiling (to native code) frequently used sections of code.这包括各种任务,如查找性能瓶颈和重新编译(到本机代码)经常使用的代码段。

Figure showing source code, compiler, and Java VM's for Win32, Solaris OS/Linux, and Mac OS

Through the Java VM, the same application is capable of running on multiple platforms.通过JavaVM,同一个应用程序能够在多个平台上运行。

The Java PlatformJava平台

A platform is the hardware or software environment in which a program runs.平台是程序运行的硬件或软件环境。We've already mentioned some of the most popular platforms like Microsoft Windows, Linux, Solaris OS, and Mac OS.我们已经提到了一些最流行的平台,如Microsoft Windows、Linux、Solaris操作系统和Mac操作系统。Most platforms can be described as a combination of the operating system and underlying hardware.大多数平台可以描述为操作系统和底层硬件的组合。The Java platform differs from most other platforms in that it‘s a software-only platform that runs on top of other hardware-based platforms.Java平台与大多数其他平台的不同之处在于,它是一个只运行软件的平台,运行在其他基于硬件的平台之上。

The Java platform has two components:Java平台有两个组件:

You've already been introduced to the Java Virtual Machine; it's the base for the Java platform and is ported onto various hardware-based platforms.已经向您介绍了Java虚拟机;它是Java平台的基础,并被移植到各种基于硬件的平台上。

The API is a large collection of ready-made software components that provide many useful capabilities.API是大量现成软件组件的集合,提供了许多有用的功能。It is grouped into libraries of related classes and interfaces; these libraries are known as packages.它被分成相关类和接口的库;这些库称为The next section, What Can Java Technology Do? highlights some of the functionality provided by the API.下一节,Java技术可以做什么?突出显示API提供的一些功能。

Figure showing MyProgram.java, API, Java Virtual Machine, and Hardware-Based Platform

The API and Java Virtual Machine insulate the program from the underlying hardware.API和Java虚拟机将程序与底层硬件隔离开来。

As a platform-independent environment, the Java platform can be a bit slower than native code.作为独立于平台的环境,Java平台可能比本机代码慢一点。However, advances in compiler and virtual machine technologies are bringing performance close to that of native code without threatening portability.然而,编译器和虚拟机技术的进步正在使性能接近本机代码,而不会威胁可移植性。

The terms"Java Virtual Machine" and "JVM" mean a Virtual Machine for the Java platform.术语“Java虚拟机”和“JVM”是指用于Java平台的虚拟机。


Previous page: The Java Technology Phenomenon
Next page: What Can Java Technology Do?