A Brief History of the Java Programming Language – Java编程语言的简史

最后修改: 2022年 1月 2日

中文/混合/英文(键盘快捷键:t)

1. Overview

1.概述

Java is one of the most popular programming languages worldwide. It was created by James Gosling and Patrick Naughton, employees of Sun Microsystems, with support from Bill Joy, co-founder of Sun Microsystems.

Java是全世界最流行的编程语言之一。它是由Sun Microsystems的员工James Gosling和Patrick Naughton在Sun Microsystems的联合创始人Bill Joy的支持下创建的。

Sun officially presented the Java language at SunWorld on May 23, 1995. Then, in 2009, the Oracle company bought the Sun company, which explains why the language now belongs to Oracle.

1995年5月23日,Sun公司在SunWorld上正式提出了Java语言。然后,在2009年,甲骨文公司收购了Sun公司,这解释了为什么该语言现在属于甲骨文公司。

In this article, we’ll explore the history of the Java programming language.

在这篇文章中,我们将探讨Java编程语言的历史

2. What Is Java?

2.什么是Java?

Java is described as being a multi-purpose, strongly typed, and Object-Oriented Programming (OOP) language. By design, it has as few implementation dependencies as possible.

Java被描述为一种多用途、强类型和面向对象编程(OOP)语言。根据设计,它具有尽可能少的实现依赖性。

With this programming language, we can create applications on multiple devices. Its scope is very wide, allowing us to create software for mobile devices, point of sale terminals, ATMs, IoT (Internet of Things), as well as web pages.

通过这种编程语言,我们可以在多种设备上创建应用程序。它的范围非常广泛,允许我们为移动设备、销售点终端、ATM机、IoT(物联网)以及网页创建软件。

Although Kotlin is the preferred language for Android development in 2021, Java is still the default language for developing apps for Android. The big reason for that is Android’s tight integration with Java. In fact, parts of that OS, like the UI and specific core libraries, are written in Java.

尽管Kotlin是2021年Android开发的首选语言,但Java仍然是为Android开发应用程序的默认语言。其主要原因是Android与Java的紧密结合。事实上,该操作系统的部分内容,如UI和特定的核心库,都是用Java编写的。

3. Brief History

3.历史简介

Let’s dive in to take a look at how the Java project started and evolved through time.

让我们深入了解一下Java项目是如何开始并随着时间的推移而演变的。

3.1. The Beginning

3.1.开端

The project was born in 1991, behind the scenes of a Sun Microsystems team, when three engineers, James Gosling, Mike Sheridan, and Patrick Naughton sought to design a language applicable to small electrical devices.

该项目诞生于1991年,在Sun Microsystems团队的幕后,当时三位工程师James Gosling、Mike Sheridan和Patrick Naughton 试图设计一种适用于小型电气设备的语言

Soon after, they launched the Green Project to study the impact of convergence between digitally controlled home appliances and computers.

不久之后,他们启动了绿色项目,研究数字控制的家用电器和计算机之间融合的影响。

Using a syntax similar to that of C++, they made a digital remote control, equipped with a graphic and animated touch screen. The fruit of several months of intense research, this remote control had the fantastic feature of controlling a whole living room equipment. It was programmed in a new language, completely independent of the processor it was running on, making the remote one-of-a-kind.

他们使用类似于C++的语法,制作了一个数字遥控器,配备了一个图形和动画触摸屏。作为几个月紧张研究的成果,这个遥控器具有控制整个客厅设备的神奇功能。它是用一种新的语言编程的,完全独立于它所运行的处理器,使这个遥控器成为独一无二的。

Ultimately, it was James Gosling, one of the members of the Green Project, who originated this new language, which he called Oak.

最终,是绿色项目的成员之一詹姆斯-高斯林提出了这种新的语言,他称之为Oak。

Afterward, the project gained ground when American cable operators joined the project. Oak then became FirstPerson. Unfortunately, the FirstPerson project had no commercial success, as it was certainly too far ahead of the industry, whose priority was, above all, profitability.

之后,当美国有线电视运营商加入该项目时,该项目获得了发展。奥克随后成为FirstPerson。不幸的是,FirstPerson项目没有取得商业上的成功,因为它肯定过于领先于行业,而行业的首要任务是盈利。

3.2. The Arrival of the HTTP Protocol and the Mosaic Browser

3.2.HTTP协议和Mosaic浏览器的到来

In 1993, the HTTP protocol and the Mosaic browser arrived, which was a crucial event for the project. During this time, the team realized that the Internet would be the ideal network to position their product.

1993年,HTTP协议和Mosaic浏览器到来,这对该项目是一个关键事件。在此期间,该团队意识到,互联网将是定位其产品的理想网络。

Then, in 1995, James Gosling unveiled a browser called WebRunner that was capable of showing HTML content mixed with Applets. Things took off from there. First, WebRunner became HotJava, then java.sun.com officially opened to the public.

然后,在1995年,詹姆斯-高斯林发布了一个名为WebRunner的浏览器,它能够显示与Applets混合的HTML内容。事情就这样开始了。首先,WebRunner变成了HotJava,然后java.sun.com正式向公众开放。

Eventually, the name of this technology would become “Java” (meaning “coffee” in American slang), in honor of the programmer’s favorite drink, namely coffee, part of the production of which comes from the island of Java.

最终,这项技术的名称变成了 “Java”(在美国俚语中意为 “咖啡”),以纪念程序员最喜欢的饮料,即咖啡,其部分生产来自爪哇岛。

It was then that Sun and Netscape announced their desire to integrate this new technology into their browsers, which definitively launched the language. The versions would then follow one another from version 1 in 1996 to version 17 in 2021.

就在这时,Sun公司和网景公司宣布,他们希望将这项新技术整合到他们的浏览器中,这就明确地推出了这种语言。随后,各版本将从1996年的第1版到2021年的第17版相继出现。

4. Features

4.特点

Thanks to its excellent features, Java has become a popular and useful programming language. Sun characterized it as being:

由于其出色的功能,Java已经成为一种流行和有用的编程语言。Sun公司将其定性为:”它是

  • Compiled and Interpreted
  • Platform Independent and Portable
  • Object-Oriented
  • Robust and Secure
  • Distributed
  • Familiar, Simple and Small
  • Multi-threaded and Interactive
  • High Performance
  • Dynamic and Extensible

Source: “Programming with Java” – E Balagurusamy.

源于此。“用Java编程” – E Balagurusamy。

Next, we’ll detail each of these features.

接下来,我们将详细介绍这些功能中的每一项。

4.1. Compiled and Interpreted

4.1.编译和解释

Java combines the power of compiled languages with the flexibility of interpreted languages.

Java结合了编译语言的力量和解释语言的灵活性。

The compiler (javac) compiles the source code into bytecode, then the Virtual Machine (JVM) executes this bytecode by transforming it into machine-readable code.

编译器(javac)将源代码编译成bytecode,然后虚拟机(JVM)通过将该字节码转换为机器可读代码而执行。

4.2. Platform Independent and Portable

4.2.平台独立和便携

The two-step compilation process is what lies behind Java’s most significant feature: platform independence, which allows for portability.

两步编译过程是Java最重要的特点背后的原因:平台独立性,它允许可移植性。

Being platform-independent means a program compiled on one machine can be executed on any other machine, regardless of the OS, as long as there is a JVM installed.

与平台无关意味着在一台机器上编译的程序可以在任何其他机器上执行,无论操作系统如何,只要安装有JVM。

The portability feature refers to the ability to run a program on different machines. In fact, the same code will run identically on different platforms, regardless of hardware compatibility or operating systems, with no changes such as recompilation or tweaks to the source code.

可移植性特征是指在不同机器上运行程序的能力。事实上,相同的代码将在不同的平台上运行完全相同,不受硬件兼容性或操作系统的影响,不需要重新编译或调整源代码等变化。

4.3. Object-Oriented

4.3.面向对象

Java strongly supports Object-Oriented Programming concepts such as encapsulation, abstraction, and inheritance.

Java强烈支持面向对象的编程概念,如封装、抽象和继承。

All the instructions and data in a Java program have to be added inside a class or object.

Java程序中的所有指令和数据都必须加在一个类或对象里面。

4.4. Robust and Secure

4.4.稳健和安全

Java includes several useful features that help us write robust and secure applications.

Java包括几个有用的功能,帮助我们编写健壮和安全的应用程序。

One of the most important ones is the memory management system, along with automatic garbage collection. Compared to languages like C/C++, Java avoids the concept of explicit pointers, and doesn’t require programmers to manually manage the allocated memory.

其中最重要的是内存管理系统,以及自动垃圾收集。与C/C++等语言相比,Java避免了显式指针的概念,也不要求程序员手动管理分配的内存。

Instead, the GC will take care of deleting unused objects to free up memory.

相反,GC将负责删除未使用的对象以释放内存。

In addition, Java is a strongly-typed language, which is a feature that can help lower the number of bugs in an application, and provides error handling mechanisms.

此外,Java是一种强类型语言,这一特点可以帮助降低应用程序中的错误数量,并提供错误处理机制。

4.5. Distributed

4.5.分布式

This feature is helpful when we develop large projects. We can split a program into many parts and store these parts on different computers. As a result, we can easily create distributed and scalable applications that run on multiple nodes.

这个功能在我们开发大型项目时很有帮助。我们可以将一个程序分成许多部分,并将这些部分存储在不同的计算机上。因此,我们可以轻松创建在多个节点上运行的分布式和可扩展的应用程序

We can achieve this using the concept of RMI (Remote Method Invocation) and EJB (Enterprise JavaBeans).

我们可以使用RMI(远程方法调用)EJB(企业级Java Bean)的概念来实现。

4.6. Simple and Familiar

4.6.简单而熟悉

First, Java is simple thanks to its coding style, which is very clean and easy to understand. Also, it doesn’t use complex and difficult features of other languages, such as the concept of explicit pointers.

首先,Java之所以简单,是因为它的编码风格非常简洁,易于理解。另外,它不使用其他语言的复杂和困难的功能,如显式指针的概念。

Finally, Java is familiar since it’s based on existing languages like C++ and incorporates many features from these languages.

最后,Java是熟悉的,因为它是基于现有的语言,如C++,并结合了这些语言的许多功能。

4.7. Multi-Threaded and Interactive

4.7.多线程和交互式

Also known as Thread-based Multitasking, multithreading is a feature that allows executing multiple threads simultaneously.

多线程也被称为基于线程的多任务,是一种允许同时执行多个线程的功能。

In short, we can write Java programs that deal with many tasks at once by defining multiple threads. The advantage of multithreading is that it doesn’t occupy memory for each thread – all threads share a common memory area.

简而言之,我们可以通过定义多个线程来编写一次处理许多任务的Java程序。多线程的优点是不占用每个线程的内存–所有线程共享一个公共内存区域

4.8. High Performance

4.8.高性能

Bytecodes that the compiler generates are highly optimized, so the Virtual Machine can execute them much faster. This is why Java is faster than other traditional interpreted programming languages.

编译器生成的字节码被高度优化,因此虚拟机可以更快地执行它们。这就是为什么Java比其他传统的解释型编程语言更快。

4.9. Dynamic and Extensible

4.9.动态和可扩展

This feature gives the facility of dynamically linking new class libraries, methods, and objects. Java is highly dynamic as it can adapt to its evolving environment.

这一特点为动态链接新的类库、方法和对象提供了便利。Java是高度动态的,因为它能适应不断变化的环境。

5. Usefulness of Java Runtime Environment

5.Java运行时环境的实用性

To be able to run a software application, it must have an environment that allows it to function – typically, an operating system such as Linux, Unix, Microsoft Windows, or macOS. In the absence of other supporting environments, programs are limited by the capabilities of the operating system and its resources.

为了能够运行一个软件应用程序,它必须有一个允许它运行的环境–通常是一个操作系统,如Linux、Unix、微软Windows或macOS。在没有其他支持环境的情况下,程序受限于操作系统的能力及其资源。

The Java Runtime Environment (JRE) acts as a translator and facilitator between the program and the operating system. It runs on top of the operating system to provide additional Java-specific resources.

Java运行环境(JRE)在程序和操作系统之间充当翻译和促进者。它运行在操作系统之上,提供额外的Java特定资源。

6. Conclusion

6.结论

Through all its specificities, the Java language synthesizes a large part of other existing languages’ possibilities while erasing some of their main faults.

通过其所有的特殊性,Java语言综合了其他现有语言的很大一部分可能性,同时消除了它们的一些主要缺点。

It is, therefore, a language commonly recognized as being relatively modern, and whose potential is well established.

因此,它是一种通常被认为是相对现代的语言,其潜力已被证实。