Платформа ява для windows для чего

Рассказываем о языке Java: для чего он используется, какие у него плюcы и минусы. А ещё сравниваем Java с C# и Python.

#статьи

  • 20 мар 2020

  • 11

Рассказываем о языке Java: для чего он используется, какие у него плюcы и минусы. А ещё сравниваем Java с C# и Python.

 vlada_maestro / shutterstock

Мария Грегуш

В бэкграунде — программирование, французский язык, академическое рисование, капоэйра. Сейчас учит финский. Любит путешествия и Балтийское море.

Даже если вы никогда не интересовались программированием, скорее всего, вы слышали название Java — и не просто так. Это один из самых популярных в мире языков программирования: он был создан в 1995 году, быстро набрал популярность и уже много лет её не теряет. В рейтинге TIOBE за ноябрь 2019 года Java заняла первое место, а по статистике GitHub — третье: второе место занял Python, а первое — JavaScript.

Java используют везде: вы найдёте её почти во всех больших компаниях, в том числе в Netflix, AliExpress, Google, Intel, eBay, TripAdvisor и многих других.

Кстати, назвали этот язык в честь одного из сортов кофе.

Оглавление

  • Java: что за зверь?
  • Что можно писать на Java
  • Плюсы и минусы Java
  • Есть ли у Java альтернатива?
  1. Java против Python
  2. Java против С#
  • А что с работой?
  • Легко ли новичку учить Java?
  • Резюмируем

Java — мультифункциональный объектно-ориентированный язык со строгой типизацией.

Что это значит?

С мультифункциональностью всё достаточно просто: Java действительно почти «волшебная таблетка» — на ней можно разрабатывать десктопные приложения, приложения под Android, заниматься веб-разработкой… Подробнее об этом ниже.

Строгая (сильная) типизация не позволяет смешивать в выражениях разные типы и не выполняет автоматически неявные преобразования. Это добавляет мороки: какие-то части приходится прописывать самому, а свободы у вас меньше, — зато в обмен на это вы получаете надёжность.

Объектно-ориентированный язык — это язык, созданный по модели объектно-ориентированного программирования. В ней существуют классы и объекты. Классы — это типы данных, а объекты — представители классов. Вы создаёте их сами, даёте названия и присваиваете им свойства и операции, которые с ними можно выполнять. Это как конструктор, который позволяет построить то, что вы хотите. Именно с помощью этой системы объектов в основном программируют на Java.

Что общего у объектно-ориентированных программистов и марксистов? И те, и другие думают о классовой структуре
Источник

Как мы отметили выше, Java используется во многих сферах. На ней пишут:

  • приложения для Android — Java практически единственный язык для них;
  • десктопные приложения;
  • промышленные программы;
  • банковские программы;
  • научные программы;
  • программы для работы с Big Data;
  • веб-приложения, веб-сервера, сервера приложений;
  • встроенные системы — от маленьких чипов до специальных компьютеров;
  • корпоративный софт.

Чаще всего вы встретите Java в веб-разработке и в приложениях для Android, но и в остальных сферах она тоже очень популярна.

У всех качеств Java, будь то строгая типизация или объектная ориентированность, есть свои плюсы и минусы, а ещё они есть у самой Java как у языка.

Плюсы

  • Независимость — ваш код будет работать на любой платформе, которая поддерживает Java.
  • Надёжность — в немалой мере достигается благодаря строгой статической типизации.
  • Мультифункциональность.
  • Сравнительно простой синтаксис.
  • Java — основной язык для Android-разработки.
  • Объектно-ориентированное программирование (ООП) тоже приносит много выгод:
  1. параллельная разработка;
  2. гибкость;
  3. одни и те же классы можно использовать много раз;
  4. код хорошо организован, и его легче поддерживать.

Минусы

  • Низкая скорость (по сравнению с С и С++).
  • Требует много памяти.
  • Нет поддержки низкоуровневого программирования (Java — высокоуровневый язык). Например, у неё нет указателей.
  • С 2019 года обновления для бизнеса и коммерческого использования стали платными.
  • Для ООП нужен опыт, а планирование новой программы занимает много времени.

Спорный момент

  • Автоматическая сборка мусора (Garbage collection): с одной стороны это выгода, но с другой стороны, разработчик не может контролировать процесс, хотя иногда это важно.

Может показаться, что Java — абсолютный лидер и у неё нет соперников, но на самом деле всё совсем наоборот. Её часто сравнивают с С# и Python, и это только главные «противники». Давайте посмотрим на них внимательнее.

Java и Python соревнуются не первый год: в рейтингах они раз за разом занимают места рядом друг с другом (вот рейтинг 2019 года). Сравнивают их не просто так, у них действительно есть общие черты: оба языка очень популярные, объектно-ориентированные и работают вне зависимости от платформы.

Давайте посмотрим, что у них различается.

Типизация

У Java статическая типизация: вы должны прописывать тип данных, когда вводите новую переменную.

У Python динамическая типизация: это значит, что типы данных не надо прописывать, они определяются автоматически. Ещё одно отличие типизации: в Python разные типы переменных можно смешивать. Но и тут есть свои границы: например, вы можете сделать массив со строками и числами, но прибавить строку к числу уже нельзя.

Python даст вам больше гибкости и лёгкости в написании, зато Java предупредит ошибки.

Читаемость

Этот пункт связан с предыдущим, потому что то же указание типов влияет на конечный вид кода. Хотя у Java достаточно простой синтаксис по сравнению с другими языками, здесь Python выигрывает. Гораздо лучше слов эту разницу покажет пример.

Вот так может выглядеть код в Python:

То же самое, написанное в Java:

Источник

В целом у синтаксиса в Python простая ясная структура, он хорошо читается, его можно даже назвать интуитивным. Он хорошо подойдёт новичкам.

В Java код более комплексный, со множеством слов и знаков: на английском такой синтаксис называют словом «verbose», то есть «говорливый» код, многословный. Он хуже читается и может быть сложноват для новичков, хотя многие разработчики чувствуют себя комфортнее со строгим синтаксисом.

Скорость

Здесь уже Java явный победитель. По сравнению с С и С++ она, может, и не самая быстрая, но Python явно отстаёт от Java по скорости и производительности. В обоих языках приложения переводятся в байт-код (это позволяет им быть кроссплатформенными), но разница кроется в том, когда это происходит: Java компилирует заранее, с помощью JIT-компиляции (динамической компиляции), а Python — во время выполнения программы. В итоге Java значительно быстрее.

Как и в случае с Python, C# сравнивают с Java не просто так: это тоже объектно-ориентированный язык со статической типизацией, и даже синтаксис у Java и C# похож.

Теперь посмотрим на их различия.

Безопасность

Один из параметров языков программирования — типобезопасность (безопасность системы типов). Если язык безопасный, то после проверки согласования типов в них уже не появится ошибка во время выполнения.

Несмотря на то что до твёрдого звания типобезопасного языка ни С#, ни Java не дотягивают, Java достаточно надёжная и разрабатывалась так, чтобы не допускать ошибок в этой области. В C# есть указатели, и такой доступ к памяти делает его менее безопасным.

Указатели и управление памятью

Вообще, если вам важно работать с указателями (например, вы хотите работать с памятью на более низком уровне), то лучше выбирать из совсем других языков (С, С++). Но если сравнивать эти два, C# побеждает: в отличие от Java, здесь указатели всё-таки есть, хоть и сильно ограниченные.

Поддержка платформ

C# разработан компанией Microsoft для их собственной экосистемы, поэтому на нём разрабатывается ПО специально для Windows. Java в этом смысле более универсальная — на ней можно писать приложения для почти любых платформ.

Применение

Если вы хотите писать веб-приложения, мессенджеры или приложения на Android или ещё не определились и поэтому хотите что-то универсальное — ваш выбор ясен: Java замечательно подойдёт.

Если же вы хотите разрабатывать приложения для Windows, то что может быть лучше, чем язык, специально для этого созданный? Кстати, C# очень хорош для разработки игр и проектов с виртуальной реальностью.

Прежде чем учить какой-то язык программирования, вы наверняка хотите знать: «А что же потом?»

Поэтому мы собрали для вас небольшую статистику по вакансиям.

На Яндекс.Работе в Москве от 900 до 1000 вакансий для Java-разработчиков, а на HeadHunter — около 2000 (все данные приведены за декабрь 2019 года).

Вакансии, в которых указана зарплата, начинаются от 70 тысяч рублей. Большинство предложений попадает в диапазон от 100 до 200 тысяч, а продвинутым разработчикам предлагают до 300 тысяч рублей.

Как вы видите, Java-разработчики востребованы, и даже по московским меркам у них хорошая зарплата (по данным Банка заработных плат HeadHunter, средняя зарплата по Москве в третьем квартале 2019 года составила 85 707 рублей).

Ещё одна возможность — работа из дома. Её выгода в том, что вам не обязательно искать предложения в одном городе. Например, HeadHunter показывает 318 предложений удалённой работы в России, с зарплатами от 90 до 150 тысяч рублей. При желании и знании языка вы можете искать варианты даже в других страна

Java легче некоторых других языков, например таких как С и С++. Большую роль в этом играет то, что в Java вам не придётся разбираться с управлением памятью. С другой стороны, как мы уже говорили, синтаксис в том же Python проще, а типизация свободнее.

Если вы совсем новичок, то учить Java может быть сложновато и стоит подумать о языках с более простым синтаксисом. Но если у вас уже есть минимальный опыт программирования, то Java — хороший выбор. Вы научитесь программированию, не распыляясь на работу с памятью, а ещё освоите объектно-ориентированное программирование. ООП не стоит бояться: оно скорее упрощает работу, чем наоборот.

Значит ли это, что не стоит пробовать, если у вас нет опыта? Вовсе нет. Если вы действительно хотите работать именно с Java, то всё-таки сможете разобраться в ней с нуля: это зависит от вашей мотивации и того, сколько времени готовы на это потратить.

Итак, Java — популярный мультифункциональный язык.

Она достаточно надёжная, быстрая, пригодится почти везде, и у неё несложный синтаксис по сравнению со многими другими языками. Да, есть языки ещё проще, но если у вас нет цели выбрать самый лёгкий, то Java — удачный средний вариант.

Java — замечательный выбор для веб-разработки, разработки приложений на Android, а также если вы хотите попробовать себя в объектно-ориентированном программировании.

Профессия Java-разработчик

Java – один из самых популярных языков программирования в мире. На нём создают надёжные приложения для банков, IT-корпораций и стриминговых сервисов, разрабатывают интернет-магазины, игры и облачные решения. Java в своих продуктах используют: Twitter, Spotify, Госуслуги, Яндекс, Билайн, Сбер, платёжная система Мир. Игры Minecraft и Assassins Creed тоже написаны на Java.Java возможно выучить самостоятельно, но гораздо проще – на курсе с поддержкой опытного эксперта.

Узнать про курс

Учись бесплатно:
вебинары по программированию, маркетингу и дизайну.

Участвовать

Школа дронов для всех
Учим программировать беспилотники и управлять ими.

Узнать больше

Java (software platform)

Dukesource125.gif

The Java technology logo

Original author(s) James Gosling, Sun Microsystems
Developer(s) Oracle Corporation
Initial release January 23, 1996; 27 years ago[1][2]
Stable release 19.0.1 (October 18, 2022; 3 months ago) [±]

17.0.5 LTS (October 18, 2022; 3 months ago) [±]
11.0.17 LTS (October 18, 2022; 3 months ago[3]) [±]

8u351 LTS (October 18, 2022; 3 months ago[4]) [±]

Written in Java, C++, C, assembly language[5]
Operating system Microsoft Windows, Linux, macOS,[6] and for old versions: Solaris
Platform x64, ARMv8, and for old versions: ARMv7, IA-32, SPARC (up to Java 14) (Java 8 includes 32-bit support for Windows – while no longer supported freely by Oracle for commercial use)[6]
Available in English, Chinese, French, German, Italian, Japanese, Korean, Portuguese, Spanish, Swedish[7]
Type Software platform
License Dual-license: GNU General Public License version 2 with classpath exception,[8] and a proprietary license.[9]
Website oracle.com/java/, java.com, dev.java

Java is a set of computer software and specifications developed by James Gosling at Sun Microsystems, which was later acquired by the Oracle Corporation, that provides a system for developing application software and deploying it in a cross-platform computing environment. Java is used in a wide variety of computing platforms from embedded devices and mobile phones to enterprise servers and supercomputers. Java applets, which are less common than standalone Java applications, were commonly run in secure, sandboxed environments to provide many features of native applications through being embedded in HTML pages.

Writing in the Java programming language is the primary way to produce code that will be deployed as byte code in a Java virtual machine (JVM); byte code compilers are also available for other languages, including Ada, JavaScript, Python, and Ruby. In addition, several languages have been designed to run natively on the JVM, including Clojure, Groovy, and Scala. Java syntax borrows heavily from C and C++, but object-oriented features are modeled after Smalltalk and Objective-C.[10] Java eschews certain low-level constructs such as pointers and has a very simple memory model where objects are allocated on the heap (while some implementations e.g. all currently supported by Oracle, may use escape analysis optimization to allocate on the stack instead) and all variables of object types are references. Memory management is handled through integrated automatic garbage collection performed by the JVM.

On November 13, 2006, Sun Microsystems made the bulk of its implementation of Java available under the GNU General Public License (GPL).[11][12]

The latest version is Java 19, released in September 2022, while Java 17, the latest long-term support (LTS), was released in September 2021. As an open source platform, Java has many distributors, including Amazon, IBM, Azul Systems, and AdoptOpenJDK. Distributions include Amazon Corretto, Zulu, AdoptOpenJDK, and Liberica. Regarding Oracle, it distributes Java 8, and also makes available e.g. Java 11, both also currently supported LTS versions. Oracle (and others) «highly recommend that you uninstall older versions of Java» than Java 8,[13] because of serious risks due to unresolved security issues.[14][15][16] Since Java 9 (as well as versions 10-16, and 18-19) are no longer supported, Oracle advises its users to «immediately transition» to a supported version. Oracle released the last free-for-commercial-use public update for the legacy Java 8 LTS in January 2019, and will continue to support Java 8 with public updates for personal use indefinitely. Oracle extended support for Java 6 ended in December 2018.[17]

Platform[edit]

The Java platform is a suite of programs that facilitate developing and running programs written in the Java programming language. A Java platform includes an execution engine (called a virtual machine), a compiler and a set of libraries; there may also be additional servers and alternative libraries that depend on the requirements. Java platforms have been implemented for a wide variety of hardware and operating systems with a view to enable Java programs to run identically on all of them. Different platforms target different classes of device and application domains:

  • Java Card: A technology that allows small Java-based applications (applets) to be run securely on smart cards and similar small-memory devices.
  • Java ME (Micro Edition): Specifies several different sets of libraries (known as profiles) for devices with limited storage, display, and power capacities. It is often used to develop applications for mobile devices, PDAs, TV set-top boxes, and printers.
  • Java SE (Standard Edition): For general-purpose use on desktop PCs, servers and similar devices.
  • Jakarta EE (Enterprise Edition): Java SE plus various APIs which are useful for multi-tier client–server enterprise applications.

The Java platform consists of several programs, each of which provides a portion of its overall capabilities. For example, the Java compiler, which converts Java source code into Java bytecode (an intermediate language for the JVM), is provided as part of the Java Development Kit (JDK). The Java Runtime Environment (JRE), complementing the JVM with a just-in-time (JIT) compiler, converts intermediate bytecode into native machine code on the fly. The Java platform also includes an extensive set of libraries.

The essential components in the platform are the Java language compiler, the libraries, and the runtime environment in which Java intermediate bytecode executes according to the rules laid out in the virtual machine specification.

Java virtual machine[edit]

The heart of the Java platform is the «virtual machine» that executes Java bytecode programs. This bytecode is the same no matter what hardware or operating system the program is running under. However, new versions, such as for Java 10 (and earlier), have made small changes, meaning the bytecode is in general only forward compatible. There is a JIT (Just In Time) compiler within the Java Virtual Machine, or JVM. The JIT compiler translates the Java bytecode into native processor instructions at run-time and caches the native code in memory during execution.

The use of bytecode as an intermediate language permits Java programs to run on any platform that has a virtual machine available. The use of a JIT compiler means that Java applications, after a short delay during loading and once they have «warmed up» by being all or mostly JIT-compiled, tend to run about as fast as native programs.[18][19][20]
Since JRE version 1.2, Sun’s JVM implementation has included a just-in-time compiler instead of an interpreter.

Although Java programs are cross-platform or platform independent, the code of the Java Virtual Machines (JVM) that execute these programs is not. Every supported operating platform has its own JVM.

Class libraries[edit]

In most modern operating systems (OSs), a large body of reusable code is provided to simplify the programmer’s job. This code is typically provided as a set of dynamically loadable libraries that applications can call at runtime. Because the Java platform is not dependent on any specific operating system, applications cannot rely on any of the pre-existing OS libraries. Instead, the Java platform provides a comprehensive set of its own standard class libraries containing many of the same reusable functions commonly found in modern operating systems. Most of the system library is also written in Java. For instance, the Swing library paints the user interface and handles the events itself, eliminating many subtle differences between how different platforms handle components.

The Java class libraries serve three purposes within the Java platform. First, like other standard code libraries, the Java libraries provide the programmer a well-known set of functions to perform common tasks, such as maintaining lists of items or performing complex string parsing. Second, the class libraries provide an abstract interface to tasks that would normally depend heavily on the hardware and operating system. Tasks such as network access and file access are often heavily intertwined with the distinctive implementations of each platform. The java.net and java.io libraries implement an abstraction layer in native OS code, then provide a standard interface for the Java applications to perform those tasks. Finally, when some underlying platform does not support all of the features a Java application expects, the class libraries work to gracefully handle the absent components, either by emulation to provide a substitute, or at least by providing a consistent way to check for the presence of a specific feature.

Languages[edit]

The word «Java», alone, usually refers to Java programming language that was designed for use with the Java platform. Programming languages are typically outside of the scope of the phrase «platform», although the Java programming language was listed as a core part of the Java platform before Java 7. The language and runtime were therefore commonly considered a single unit. However, an effort was made with the Java 7 specification to more clearly treat the Java language and the Java Virtual Machine as separate entities, so that they are no longer considered a single unit.[21]

Third parties have produced many compilers or interpreters that target the JVM. Some of these are for existing languages, while others are for extensions to the Java language. These include:

  • BeanShell – a lightweight scripting language for Java[22] (see also JShell)
  • Ceylon – an object-oriented, strongly statically typed programming language with an emphasis on immutability
  • Clojure – a modern, dynamic, and functional dialect of the Lisp programming language on the Java platform
  • Gosu – a general-purpose Java Virtual Machine-based programming language released under the Apache License 2.0
  • Groovy – a fully Java interoperable, Java-syntax-compatible, static and dynamic language with features from Python, Ruby, Perl, and Smalltalk
  • JRuby – a Ruby interpreter
  • Jython – a Python interpreter
  • Kotlin – an industrial programming language for JVM with full Java interoperability
  • Rhino – a JavaScript interpreter
  • Scala – a multi-paradigm programming language with non-Java compatible syntax designed as a «better Java»

Similar platforms[edit]

The success of Java and its write once, run anywhere concept has led to other similar efforts, notably the .NET Framework, appearing since 2002, which incorporates many of the successful aspects of Java. .NET was built from the ground-up to support multiple programming languages, while the Java platform was initially built to support only the Java language, although many other languages have been made for JVM since. Like Java, .NET languages compile to byte code and are executed by the Common
Language Runtime (CLR), which is similar in purpose to the JVM. Like the JVM, the CLR provides memory management through automatic garbage collection, and allows .NET byte code to run on multiple operating systems.

.NET included a Java-like language first named J++, then called Visual J# that was incompatible with the Java specification. It was discontinued 2007, and support for it ended in 2015.

Java Development Kit[edit]

The Java Development Kit (JDK) is a Sun product aimed at Java developers. Since the introduction of Java, it has been by far the most widely used Java software development kit (SDK).[citation needed] It contains a Java compiler, a full copy of the Java Runtime Environment (JRE), and many other important development tools.

Java Runtime Environment[edit]

The Java Runtime Environment (JRE) released by Oracle is a freely available software distribution containing a stand-alone JVM (HotSpot), the Java standard library (Java Class Library), a configuration tool, and—until its discontinuation in JDK 9—a browser plug-in. It is the most common Java environment installed on personal computers in the laptop and desktop form factor. Mobile phones including feature phones and early smartphones that ship with a JVM are most likely to include a JVM meant to run applications targeting Micro Edition of the Java platform. Meanwhile, most modern smartphones, tablet computers, and other handheld PCs that run Java apps are most likely to do so through support of the Android operating system, which includes an open source virtual machine incompatible with the JVM specification. (Instead, Google’s Android development tools take Java programs as input and output Dalvik bytecode, which is the native input format for the virtual machine on Android devices.)
The last Critical Path Update version of JRE with an Oracle BCL Agreement[23] was 8u201 and, the last Patch Set Update version with the same license was 8u202.[24][25] The last Oracle JRE implementation, regardless of its licensing scheme, was 9.0.4.[26]Since Java Platform SE 9, the whole platform also was grouped into modules.[27] The modularization of Java SE implementations allows developers to bundle their applications together with all the modules used by them, instead of solely relying on the presence of a suitable Java SE implementation in the user device.[28][29][30][31]

Performance[edit]

The JVM specification gives a lot of leeway to implementors regarding the implementation details. Since Java 1.3, JRE from Oracle contains a JVM called HotSpot. It has been designed to be a high-performance JVM.

To speed-up code execution, HotSpot relies on just-in-time compilation. To speed-up object allocation and garbage collection, HotSpot uses generational heap.

Generational heap[edit]

The Java virtual machine heap is the area of memory used by the JVM for dynamic memory allocation.[32]

In HotSpot the heap is divided into generations:

  • The young generation stores short-lived objects that are created and immediately garbage collected.
  • Objects that persist longer are moved to the old generation (also called the tenured generation). This memory is subdivided into (two) Survivors spaces where the objects that survived the first and next garbage collections are stored.

The permanent generation (or permgen) was used for class definitions and associated metadata prior to Java 8. Permanent generation was not part of the heap.[33][34] The permanent generation was removed from Java 8.[35]

Originally there was no permanent generation, and objects and classes were stored together in the same area. But as class unloading occurs much more rarely than objects are collected, moving class structures to a specific area allowed significant performance improvements.[33]

Security[edit]

Oracle’s JRE is installed on a large number of computers. End users with an out-of-date version of JRE therefore are vulnerable to many known attacks. This led to the widely shared belief that Java is inherently insecure.[36] Since Java 1.7, Oracle’s JRE for Windows includes automatic update functionality.

Before the discontinuation of the Java browser plug-in, any web page might have potentially run a Java applet, which provided an easily accessible attack surface to malicious web sites. In 2013 Kaspersky Labs reported that the Java plug-in was the method of choice for computer criminals. Java exploits are included in many exploit packs that hackers deploy onto hacked web sites.[37] Java applets were removed in Java 11, released on September 25, 2018.

History[edit]

The Java platform and language began as an internal project at Sun Microsystems in December 1990, providing an alternative to the C++/C programming languages. Engineer Patrick Naughton had become increasingly frustrated with the state of Sun’s C++ and C application programming interfaces (APIs) and tools, as well as with the way the NeWS project was handled by the organization. Naughton informed Scott McNealy about his plan of leaving Sun and moving to NeXT; McNealy asked him to pretend he was God and send him an e-mail explaining how to fix the company. Naughton envisioned the creation of a small team that could work autonomously without the bureaucracy that was stalling other Sun projects. McNealy forwarded the message to other important people at Sun, and the Stealth Project started.[38]

The Stealth Project was soon renamed to the Green Project, with James Gosling and Mike Sheridan joining Naughton. Together with other engineers, they began work in a small office on Sand Hill Road in Menlo Park, California. They aimed to develop new technology for programming next-generation smart appliances, which Sun expected to offer major new opportunities.[39]

The team originally considered using C++, but rejected it for several reasons. Because they were developing an embedded system with limited resources, they decided that C++ needed too much memory and that its complexity led to developer errors. The language’s lack of garbage collection meant that programmers had to manually manage system memory, a challenging and error-prone task. The team also worried about the C++ language’s lack of portable facilities for security, distributed programming, and threading. Finally, they wanted a platform that would port easily to all types of devices.

Bill Joy had envisioned a new language combining Mesa and C. In a paper called Further, he proposed to Sun that its engineers should produce an object-oriented environment based on C++. Initially, Gosling attempted to modify and extend C++ (a proposed development that he referred to as «C++ ++ —«) but soon abandoned that in favor of creating a new language, which he called Oak, after the tree that stood just outside his office.[40]

By the summer of 1992, the team could demonstrate portions of the new platform, including the Green OS, the Oak language, the libraries, and the hardware. Their first demonstration, on September 3, 1992, focused on building a personal digital assistant (PDA) device named Star7[1] that had a graphical interface and a smart agent called «Duke» to assist the user. In November of that year, the Green Project was spun off to become Firstperson, a wholly owned subsidiary of Sun Microsystems, and the team relocated to Palo Alto, California.[41] The Firstperson team had an interest in building highly interactive devices, and when Time Warner issued a request for proposal (RFP) for a set-top box, Firstperson changed their target and responded with a proposal for a set-top box platform. However, the cable industry felt that their platform gave too much control to the user, so Firstperson lost their bid to SGI. An additional deal with The 3DO Company for a set-top box also failed to materialize. Unable to generate interest within the television industry, the company was rolled back into Sun.

Java meets the Web[edit]

In June and July 1994 – after three days of brainstorming with John Gage (the Director of Science for Sun), Gosling, Joy, Naughton, Wayne Rosing, and Eric Schmidt – the team re-targeted the platform for the World Wide Web. They felt that with the advent of graphical web browsers like Mosaic the Internet could evolve into the same highly interactive medium that they had envisioned for cable TV. As a prototype, Naughton wrote a small browser, WebRunner (named after the movie Blade Runner), renamed HotJava[39] in 1995.

Sun renamed the Oak language to Java after a trademark search revealed that Oak Technology used the name Oak.[42] Sun priced Java licenses below cost to gain market share.[43] Although Java 1.0a became available for download in 1994, the first public release of Java, Java 1.0a2 with the HotJava browser, came on May 23, 1995, announced by Gage at the SunWorld conference. Accompanying Gage’s announcement, Marc Andreessen, Executive Vice President of Netscape Communications Corporation, unexpectedly announced that Netscape browsers would include Java support. On January 9, 1996, Sun Microsystems formed the JavaSoft group to develop the technology.[44]

While the so-called Java applets for web browsers no longer are the most popular use of Java (with it e.g. more used server-side) or the most popular way to run code client-side (JavaScript took over as more popular), it still is possible to run Java (or other JVM-languages such as Kotlin) in web browsers, even after JVM-support has been dropped from them, using e.g. TeaVM.

Version history[edit]

The Java language has undergone several changes since the release of JDK (Java Development Kit) 1.0 on January 23, 1996, as well as numerous additions of classes and packages to the standard library. Since J2SE 1.4 the Java Community Process (JCP) has governed the evolution of the Java Language. The JCP uses Java Specification Requests (JSRs) to propose and specify additions and changes to the Java platform. The Java Language Specification (JLS) specifies the language; changes to the JLS are managed under JSR 901.[45]

Sun released JDK 1.1 on February 19, 1997. Major additions included an extensive retooling of the AWT event model, inner classes added to the language, JavaBeans and JDBC.

J2SE 1.2 (December 8, 1998) – Codename Playground. This and subsequent releases through J2SE 5.0 were rebranded Java 2 and the version name «J2SE» (Java 2 Platform, Standard Edition) replaced JDK to distinguish the base platform from J2EE (Java 2 Platform, Enterprise Edition) and J2ME (Java 2 Platform, Micro Edition). Major additions included reflection, a collections framework, Java IDL (an interface description language implementation for CORBA interoperability), and the integration of the Swing graphical API into the core classes. A Java Plug-in was released, and Sun’s JVM was equipped with a JIT compiler for the first time.

J2SE 1.3 (May 8, 2000) – Codename Kestrel. Notable changes included the bundling of the HotSpot JVM (the HotSpot JVM was first released in April, 1999 for the J2SE 1.2 JVM), JavaSound, Java Naming and Directory Interface (JNDI) and Java Platform Debugger Architecture (JPDA).

J2SE 1.4 (February 6, 2002) – Codename Merlin. This became the first release of the Java platform developed under the Java Community Process as JSR 59.[46] Major changes included regular expressions modeled after Perl, exception chaining, an integrated XML parser and XSLT processor (JAXP), and Java Web Start.

J2SE 5.0 (September 30, 2004) – Codename Tiger. It was originally numbered 1.5, which is still used as the internal version number.[47] Developed under JSR 176, Tiger added several significant new language features including the for-each loop, generics, autoboxing and var-args.[48]

Java SE 6 (December 11, 2006) – Codename Mustang. It was bundled with a database manager and facilitates the use of scripting languages with the JVM (such as JavaScript using Mozilla’s Rhino engine). As of this version, Sun replaced the name «J2SE» with Java SE and dropped the «.0» from the version number.[49] Other major changes include support for pluggable annotations (JSR 269), many GUI improvements, including native UI enhancements to support the look and feel of Windows Vista, and improvements to the Java Platform Debugger Architecture (JPDA) & JVM Tool Interface for better monitoring and troubleshooting.

Java SE 7 (July 28, 2011) – Codename Dolphin. This version developed under JSR 336.[50] It added many small language changes including strings in switch, try-with-resources and type inference for generic instance creation. The JVM was extended with support for dynamic languages, while the class library was extended among others with a join/fork framework,[51] an improved new file I/O library and support for new network protocols such as SCTP. Java 7 Update 76 was released in January 2015, with expiration date April 14, 2015.[52]

In June 2016, after the last public update of Java 7,[53] «remotely exploitable» security bugs in Java 6, 7, and 8 were announced.[15]

Java SE 8 (March 18, 2014) – Codename Kenai. Notable changes include language-level support for lambda expressions (closures) and default methods, the Project Nashorn JavaScript runtime, a new Date and Time API inspired by Joda Time, and the removal of PermGen. This version is not officially supported on the Windows XP platform.[54] However, due to the end of Java 7’s lifecycle it is the recommended version for XP users. Previously, only an unofficial manual installation method had been described for Windows XP SP3. It refers to JDK8, the developing platform for Java that also includes a fully functioning Java Runtime Environment.[55] Java 8 is supported on Windows Server 2008 R2 SP1, Windows Vista SP2 and Windows 7 SP1, Ubuntu 12.04 LTS and higher (and some other OSes).[56]

Java SE 9 and 10 had higher system requirements, i.e. Windows 7 or Server 2012 (and web browser minimum certified is upped to Internet Explorer 11 or other web browsers), and Oracle dropped 32-bit compatibility for all platforms, i.e. only Oracle’s «64-bit Java virtual machines (JVMs) are certified».[57]

Java SE 11 was released September 2018, the first LTS release since the rapid release model was adopted starting with version 9. For the first time, OpenJDK 11 represents the complete source code for the Java platform under the GNU General Public License, and while Oracle still dual-licenses it with an optional proprietary license, there are no code differences nor modules unique to the proprietary-licensed version.[58] Java 11 features include two new garbage collector implementations, Flight Recorder to debug deep issues, a new HTTP client including WebSocket support.[59]

Java SE 12 was released March 2019.[60]

Java SE 13 was released September 2019.[61]

Java SE 14 was released March 2020.[62]

Java SE 15 was released September 2020.

Java SE 16 was released March 2021.

Java SE 17 was released September 2021.

Java SE 18 was released March 2022.

Java SE 19 was released September 2022.

In addition to language changes, significant changes have been made to the Java class library over the years, which has grown from a few hundred classes in JDK 1.0 to over three thousand in J2SE 5.0. Entire new APIs, such as Swing and Java 2D, have evolved, and many of the original JDK 1.0 classes and methods have been deprecated.

Usage[edit]

Desktop use[edit]

A Java program running on a Windows Vista desktop computer (supported by Java 8, but not officially by later versions, such as Java 11)

According to Oracle in 2010, the Java Runtime Environment was found on over 850 million PCs.[63] Microsoft has not bundled a Java Runtime Environment (JRE) with its operating systems since Sun Microsystems sued Microsoft for adding Windows-specific classes to the bundled Java runtime environment, and for making the new classes available through Visual J++.[citation needed] Apple no longer includes a Java runtime with OS X as of version 10.7, but the system prompts the user to download and install it the first time an application requiring the JRE is launched.[citation needed] Many Linux distributions include the OpenJDK runtime as the default virtual machine, negating the need to download the proprietary Oracle JRE.[64]

Some Java applications are in fairly widespread desktop use, including the NetBeans and Eclipse integrated development environments, and file sharing clients such as LimeWire and Vuze. Java is also used in the MATLAB mathematics programming environment, both for rendering the user interface and as part of the core system. Java provides cross platform user interface for some high end collaborative applications such as Lotus Notes.

Oracle plans to first deprecate the separately installable Java browser plugin from the Java Runtime Environment in JDK 9 then remove it completely from a future release, forcing web developers to use an alternative technology.[65]

Mascot[edit]

Duke is Java’s mascot.[66]

When Sun announced that Java SE and Java ME would be released under a free software license (the GNU General Public License), they released the Duke graphics under the free BSD license at the same time.[67] A new Duke personality is created every year.[68] For example, in July 2011 «Future Tech Duke» included a bigger nose, a jetpack, and blue wings.[69]

Licensing[edit]

The source code for Sun’s implementations of Java (i.e. the de facto reference implementation) has been available for some time, but until recently,[70] the license terms severely restricted what could be done with it without signing (and generally paying for) a contract with Sun. As such these terms did not satisfy the requirements of either the Open Source Initiative or the Free Software Foundation to be considered open source or free software, and Sun Java was therefore a proprietary platform.[71]

While several third-party projects (e.g. GNU Classpath and Apache Harmony) created free software partial Java implementations, the large size of the Sun libraries combined with the use of clean room methods meant that their implementations of the Java libraries (the compiler and VM are comparatively small and well defined) were incomplete and not fully compatible. These implementations also tended to be far less optimized than Sun’s.[citation needed]

Free software[edit]

Sun announced in JavaOne 2006 that Java would become free and open source software,[72] and on October 25, 2006, at the Oracle OpenWorld conference, Jonathan I. Schwartz said that the company was set to announce the release of the core Java Platform as free and open source software within 30 to 60 days.[73]

Sun released the Java HotSpot virtual machine and compiler as free software under the GNU General Public License on November 13, 2006, with a promise that the rest of the JDK (that includes the JRE) would be placed under the GPL by March 2007 («except for a few components that Sun does not have the right to publish in distributable source form under the GPL»).[74] According to Richard Stallman, this would mean an end to the «Java trap».[75] Mark Shuttleworth called the initial press announcement, «A real milestone for the free software community».[76]

Sun released the source code of the Class library under GPL on May 8, 2007, except some limited parts that were licensed by Sun from third parties who did not want their code to be released under a free software and open-source license.[77] Some of the encumbered parts turned out to be fairly key parts of the platform such as font rendering and 2D rasterising, but these were released as open-source later by Sun (see OpenJDK Class library).

Sun’s goal was to replace the parts that remain proprietary and closed-source with alternative implementations and make the class library completely free and open source. In the meantime, a third-party project called IcedTea created a completely free and highly usable JDK by replacing encumbered code with either stubs or code from GNU Classpath. However OpenJDK has since become buildable without the encumbered parts (from OpenJDK 6 b10[78]) and has become the default runtime environment for most Linux distributions.[79][80][81][82]

In June 2008, it was announced that IcedTea6 (as the packaged version of OpenJDK on Fedora 9) has passed the Technology Compatibility Kit tests and can claim to be a fully compatible Java 6 implementation.[83]

Because OpenJDK is under the GPL, it is possible to redistribute a custom version of the JRE directly with software applications,[84][85] rather than requiring the enduser (or their sysadmin) to download and install the correct version of the proprietary Oracle JRE onto each of their systems themselves.

Criticism[edit]

In most cases, Java support is unnecessary in Web browsers, and security experts recommend that it not be run in a browser unless absolutely necessary.[86] It was suggested that, if Java is required by a few Web sites, users should have a separate browser installation specifically for those sites.[citation needed]

Generics[edit]

When generics were added to Java 5.0, there was already a large framework of classes (many of which were already deprecated), so generics were chosen to be implemented using erasure to allow for migration compatibility and re-use of these existing classes. This limited the features that could be provided by this addition as compared to some other languages.[87][88] The addition of type wildcards made Java unsound.[89]

Unsigned integer types[edit]

Java lacks native unsigned integer types. Unsigned data are often generated from programs written in C and the lack of these types prevents direct data interchange between C and Java. Unsigned large numbers are also used in many numeric processing fields, including cryptography, which can make Java less convenient to use for these tasks.[90]
Although it is possible to partially circumvent this problem with conversion code and using larger data types, it makes using Java cumbersome for handling the unsigned data. While a 32-bit signed integer may be used to hold a 16-bit unsigned value with relative ease, a 32-bit unsigned value would require a 64-bit signed integer. Additionally, a 64-bit unsigned value cannot be stored using any integer type in Java because no type larger than 64 bits exists in the Java language. If abstracted using functions, function calls become necessary for many operations which are native to some other languages. Alternatively, it is possible to use Java’s signed integers to emulate unsigned integers of the same size, but this requires detailed knowledge of complex bitwise operations.[91]

Floating point arithmetic[edit]

While Java’s floating point arithmetic is largely based on IEEE 754 (Standard for Binary Floating-Point Arithmetic), certain features are not supported even when using the strictfp modifier, such as Exception Flags and Directed Roundings – capabilities mandated by IEEE Standard 754. Additionally, the extended precision floating-point types permitted in 754 and present in many processors are not permitted in Java.[92][93]

Performance[edit]

In the early days of Java (before the HotSpot VM was implemented in Java 1.3 in 2000) there were some criticisms of performance. Benchmarks typically reported Java as being about 50% slower than C (a language which compiles to native code).[94][95][96]

Java’s performance has improved substantially since the early versions.[18] Performance of JIT compilers relative to native compilers has in some optimized tests been shown to be quite similar.[18][19][20]

Java bytecode can either be interpreted at run time by a virtual machine, or it can be compiled at load time or runtime into native code which runs directly on the computer’s hardware. Interpretation is slower than native execution, and compilation at load time or runtime has an initial performance penalty for the compilation. Modern performant JVM implementations all use the compilation approach, so after the initial startup time the performance is equivalent to native code.

Security[edit]

The Java platform provides a security architecture[97] which is designed to allow the user to run untrusted bytecode in a «sandboxed» manner to protect against malicious or poorly written software. This «sandboxing» feature is intended to protect the user by restricting access to certain platform features and APIs which could be exploited by malware, such as accessing the local filesystem, running arbitrary commands, or accessing communication networks.

In recent years, researchers have discovered numerous security flaws in some widely used Java implementations, including Oracle’s, which allow untrusted code to bypass the sandboxing mechanism, exposing users to malicious attacks. These flaws affect only Java applications which execute arbitrary untrusted bytecode, such as web browser plug-ins that run Java applets downloaded from public websites. Applications where the user trusts, and has full control over, all code that is being executed are unaffected.

On August 31, 2012, Java 6 and 7 (both supported back then) on Microsoft Windows, OS X, and Linux were found to have a serious security flaw that allowed a remote exploit to take place by simply loading a malicious web page.[98] Java 5 was later found to be flawed as well.[99]

On January 10, 2013, three computer specialists spoke out against Java, telling Reuters that it was not secure and that people should disable Java. Jaime Blasco, Labs Manager with AlienVault Labs, stated that «Java is a mess. It’s not secure. You have to disable it.»[100]
This vulnerability affects Java 7 and it is unclear if it affects Java 6, so it is suggested that consumers disable it.[101][102] Security alerts from Oracle announce schedules of critical security-related patches to Java.[103]

On January 14, 2013, security experts said that the update still failed to protect PCs from attack.[104] This exploit hole prompted a response from the United States Department of Homeland Security encouraging users to disable or uninstall Java.[16] Apple blacklisted Java in limited order for all computers running its OS X operating system through a virus protection program.[105]

In 2014 and responding to then-recent Java security and vulnerability issues, security blogger Brian Krebs has called for users to remove at least the Java browser plugin and also the entire software. «I look forward to a world without the Java plugin (and to not having to remind readers about quarterly patch updates) but it will probably be years before various versions of this plugin are mostly removed from end-user systems worldwide.»[106] «Once promising, it has outlived its usefulness in the browser, and has become a nightmare that delights cyber-criminals at the expense of computer users.»[107] «I think everyone should uninstall Java from all their PCs and Macs, and then think carefully about whether they need to add it back. If you are a typical home user, you can probably do without it. If you are a business user, you may not have a choice.»[108]

Adware[edit]

The Oracle-distributed Java runtime environment has a history of bundling sponsored software to be installed by default during installation and during the updates which roll out every month or so. This includes the «Ask.com toolbar» that will redirect browser searches to ads and «McAfee Security Scan Plus».[109] These offers can be blocked through a setting in the Java Control Panel, although this is not obvious. This setting is located under the «Advanced» tab in the Java Control Panel, under the «Miscellaneous» heading, where the option is labelled as an option to suppress «sponsor offers».

Update system[edit]

Java has yet to release an automatic updater that does not require user intervention and administrative rights[110] unlike Google Chrome[111] and Flash player.[112]

See also[edit]

  • List of Java APIs
  • Java logging frameworks
  • Java performance
  • JavaFX
  • Jazelle
  • Java ConcurrentMap
  • Comparison of the Java and .NET platforms
  • List of JVM languages
  • List of computing mascots

References[edit]

  1. ^ «JavaSoft ships Java 1.0» (Press release). Archived from the original on February 5, 2008. Retrieved February 9, 2016.
  2. ^ Ortiz, C. Enrique; Giguère, Éric (2001). Mobile Information Device Profile for Java 2 Micro Edition: Developer’s Guide (PDF). John Wiley & Sons. ISBN 978-0471034650. Retrieved May 30, 2012.
  3. ^ «JDK Releases». Oracle Corporation. Retrieved December 9, 2022.
  4. ^ «JDK Releases». Oracle Corporation. Retrieved December 9, 2022.
  5. ^ «HotSpot Group». Openjdk.java.net. Retrieved February 9, 2016.
  6. ^ a b «Oracle JDK 8 and JRE 8 Certified System Configurations Contents». Oracle.com. April 8, 2014. Retrieved February 9, 2016.
  7. ^ «Java SE 7 Supported Locales». Oracle.com. Retrieved February 9, 2016.
  8. ^ «OpenJDK: GPLv2 + Classpath Exception». Openjdk.java.net. April 1, 1989. Retrieved February 9, 2016.
  9. ^ «BCL For Java SE». Oracle.com. April 2, 2013. Retrieved February 9, 2016.
  10. ^ Naughton, Patrick. «Java Was Strongly Influenced by Objective-C». Virtual School. Archived from the original on August 13, 2012.
  11. ^ «Sun Opens Java». Sun Microsystems. November 13, 2006. Archived from the original on May 13, 2008.
  12. ^ O’Hair, Kelly (December 2010). «OpenJDK7 and OpenJDK6 Binary Plugs Logic Removed». Oracle Corporation. Retrieved November 25, 2011.
  13. ^ «Why should I uninstall older versions of Java from my system?». www.java.com. Archived from the original on February 12, 2018. Retrieved February 6, 2018.
  14. ^ «Why should I uninstall older versions of Java from my system?». Oracle. Retrieved September 9, 2016.
  15. ^ a b «Oracle Critical Patch Update — July 2016». www.oracle.com.
  16. ^ a b Whittaker, Zack (January 11, 2013). «Homeland Security warns to disable Java amid zero-day flaw». ZDNet. Retrieved February 9, 2016.
  17. ^ Alexander, Christopher. «Java SE 6 Advanced». www.oracle.com. Retrieved May 20, 2018.
  18. ^ a b c Lewis, J. P.; Neumann, Ulrich. «Performance of Java versus C++». Graphics and Immersive Technology Lab, University of Southern California.
  19. ^ a b «The Java Faster than C++ Benchmark». Kano.net. November 14, 2003. Retrieved February 9, 2016.
  20. ^ a b FreeTTS – A Performance Case Study Archived 2009-03-25 at the Wayback Machine, Willie Walker, Paul Lamere, Philip Kwok
  21. ^ «Chapter 1. Introduction». docs.oracle.com.
  22. ^ www.beanshell.org
  23. ^ https://www.oracle.com/downloads/licenses/binary-code-license.html[dead link]
  24. ^ «Java CPU and PSU Releases Explained». Archived from the original on November 3, 2014.
  25. ^ https://www.oracle.com/java/technologies/javase/javase8-archive-downloads.html[dead link]
  26. ^ https://www.oracle.com/java/technologies/javase/javase9-archive-downloads.html[dead link]
  27. ^ https://www.oracle.com/corporate/features/understanding-java-9-modules.html[dead link]
  28. ^ «Java Modules».
  29. ^ «Java 9 Structural Changes in the JDK and JRE». October 30, 2017.
  30. ^ «IBM Developer».
  31. ^ «A Guide to Java 9 Modularity | Baeldung». April 18, 2018.
  32. ^ «Frequently Asked Questions about Garbage Collection in the Hotspot Java Virtual Machine». Sun Microsystems. February 6, 2003. Retrieved February 7, 2009.
  33. ^ a b Masamitsu, Jon (November 28, 2006). «Presenting the Permanent Generation». Archived from the original on August 25, 2016. Retrieved February 7, 2009.
  34. ^ Nutter, Charles (September 11, 2008). «A First Taste of InvokeDynamic». Retrieved February 7, 2009.
  35. ^ «JEP 122: Remove the Permanent Generation». Oracle Corporation. December 4, 2012. Retrieved March 23, 2014.
  36. ^ «What Is Java, Is It Insecure, and Should I Use It?». Lifehacker.com. January 14, 2013. Retrieved June 26, 2015.
  37. ^ «Is there any protection against Java exploits? | Kaspersky Lab». Kaspersky.com. September 9, 2013. Archived from the original on April 4, 2015. Retrieved June 26, 2015.
  38. ^ Southwick, Karen (1999). High Noon: the inside story of Scott McNealy and the rise of Sun Microsystems. New York [u.a.]: Wiley. pp. 120–122. ISBN 0471297135.
  39. ^ a b Byous, Jon (April 2003). «Java Technology: The Early Years». Sun Microsystems. Archived from the original on May 30, 2008. Retrieved August 2, 2009.
  40. ^ Southwick, Karen (1999). High Noon: the inside story of Scott McNealy and the rise of Sun Microsystems. New York [u.a.]: Wiley. p. 124. ISBN 0471297135.
  41. ^
    Walrath, Kathy (December 21, 2001). «Foreword». Sun Microsystems. Retrieved August 2, 2009.
  42. ^ Murphy, Kieron (4 October 1996). «So why did they decide to call it Java?». JavaWorld. Retrieved 2020-07-15. ‘The lawyers had told us that we couldn’t use the name «OAK» because [it was already trademarked by] Oak Technologies,’ said Frank Yellin, a senior engineer at Sun. ‘So a brainstorming session was held to come up with ideas for a new name.’
  43. ^ Bank, David (December 1, 1995). «The Java Saga». Wired. Retrieved October 4, 2022. ‘It’s priced below our cost,’ Schmidt says. ‘This loses money in the licensing business for the foreseeable future. It’s a strategic investment in market share.’
  44. ^ «Sun Microsystems announces formation of JavaSoft» (Press release). Sun Microsystems. 9 January 1996. Archived from the original on 2008-02-10.
  45. ^ «The Java Community Process(SM) Program — JSRs: Java Specification Requests — detail JSR# 63». Jcp.org. Retrieved February 9, 2016.
  46. ^ «The Java Community Process(SM) Program — JSRs: Java Specification Requests — detail JSR# 59». Jcp.org. Retrieved February 9, 2016.
  47. ^ «Version 1.5.0 or 5.0?». Java.sun.com. Retrieved February 9, 2016.
  48. ^ «The Java Community Process(SM) Program — JSRs: Java Specification Requests — detail JSR# 176». Jcp.org. Retrieved February 9, 2016.
  49. ^ «Java Naming». Java.com. Oracle. Retrieved August 25, 2011.
  50. ^ «The Java Community Process(SM) Program — JSRs: Java Specification Requests — detail JSR# 336». Jcp.org. Retrieved February 9, 2016.
  51. ^ Lea, Doug (September 13, 2004). «JSRs: Java Specification Requests: JSR 166: Concurrency Utilities». Java Community Process. Oracle Corp.
  52. ^ «Java™ SE Development Kit 7 Update 76 Release Notes». Oracle.com. Retrieved February 9, 2016.
  53. ^ «Java 7 and Java 8 Releases by Date». www.java.com.
  54. ^ «Windows XP and Java». Java.com. April 8, 2014. Retrieved February 9, 2016.
  55. ^ «java — installing JDK8 on Windows XP — advapi32.dll error». Stack Overflow.
  56. ^ «Oracle JDK 8 and JRE 8 Certified System Configurations». www.oracle.com.
  57. ^ «Oracle JDK 10 Certified System Configurations». www.oracle.com. Retrieved March 27, 2018. Only X.org Mode supported. Wayland mode is unsupported.
  58. ^ «Oracle Java SE Support Roadmap». Oracle Corporation. September 25, 2018. Retrieved September 25, 2018.
  59. ^ «JDK 11». Oracle Corporation. September 25, 2018. Retrieved September 26, 2018.
  60. ^ «JDK 12». OpenJDK. Retrieved March 22, 2019.
  61. ^ «JDK 13». OpenJDK. Retrieved September 17, 2019.
  62. ^ «JDK 14». OpenJDK. Retrieved March 25, 2020.
  63. ^ «What is Java technology and why do I need it?». Archived from the original on September 25, 2010. Retrieved December 15, 2011. Java runs on more than 850 million personal computers worldwide, and on billions of devices worldwide, including mobile and TV devices.
  64. ^ «Java — Fedora Project Wiki». fedoraproject.org.
  65. ^ Topic, Dalibor (January 27, 2016). «Moving to a plugin-free web». Oracle.
  66. ^ «Duke, the Java Mascot». Oracle. Retrieved March 18, 2019.
  67. ^ «duke: Project Home Page». Sun Microsystems. Archived from the original on June 18, 2007. Retrieved March 18, 2007.
  68. ^ «Duke, the Java Mascot».
  69. ^ «Future Tech Duke (The Java Source)». Tori Wieldt. Archived from the original on August 20, 2011. Retrieved August 17, 2011.
  70. ^ Smith, Donald (September 11, 2018). «Oracle JDK Releases for Java 11 and Later».
  71. ^ Stallman, Richard (May 24, 2006). «The Curious Incident of Sun in the Night-Time». Groklaw.
  72. ^ Schwartz, Jonathan. «?». Jonathan Schwartz’s Blog. Sun Microsystems. Archived from the original on July 15, 2006.
  73. ^ «Oracle OpenWorld: UnBreakable Linux / 5015.2 not on the horizon | Formtek Blog». Formtek.com. October 26, 2006. Retrieved February 9, 2016.
  74. ^ «Oracle and Sun Microsystems | Strategic Acquisitions | Oracle». Sun.com. Retrieved February 9, 2016.
  75. ^ «Free but Shackled — The Java Trap — GNU Project — Free Software Foundation». Gnu.org. April 12, 2004. Retrieved February 9, 2016.
  76. ^ «Sun ‘releases’ Java to the World». BBC News. November 13, 2006. Retrieved May 6, 2010.
  77. ^ «Open JDK is here!». Sun Microsystems. May 8, 2007. Retrieved May 9, 2007.
  78. ^ Wielaard, Mark (May 30, 2007). «OpenJDK6 b10 source posted». Retrieved July 12, 2008.
  79. ^ «Redhat Java».
  80. ^ «Fedora Java».
  81. ^ «Debian Java».
  82. ^ «Ubuntu Java».
  83. ^ Sharples, Rich (June 19, 2008). «Java is finally Free and Open». Archived from the original on June 20, 2008.
  84. ^ libgdx (December 9, 2013). «Bundling a jre · libgdx/libgdx Wiki · GitHub». Github.com. Retrieved February 9, 2016.
  85. ^ «Question about bundling custom OpenJDK». Java-Gaming.org. Archived from the original on March 4, 2016. Retrieved February 9, 2016.
  86. ^ Cluley, Graham (January 15, 2013). ««Unless it is absolutely necessary to run Java in web browsers, disable it», DHS-sponsored CERT team says – Naked Security». Nakedsecurity.sophos.com. Retrieved February 9, 2016.
  87. ^ «Generics in Java». Object Computing, Inc. Archived from the original on January 2, 2007. Retrieved December 9, 2006.
  88. ^ «What’s Wrong With Java: Type Erasure». December 6, 2006. Retrieved December 9, 2006.
  89. ^ «Java and Scala’s Type Systems are Unsound» (PDF).
  90. ^
    «Java libraries should provide support for unsigned integer arithmetic». Bug Database, Sun Developer Network. Oracle. Retrieved January 18, 2011.
  91. ^ Owens, Sean R. (November 5, 2009). «Java and unsigned int, unsigned short, unsigned byte, unsigned long, etc. (Or rather, the lack thereof)». darksleep.com. Retrieved October 9, 2010.
  92. ^ Kahan, W.; Darcy, Joseph D. (March 1, 1998). «How Java’s Floating-Point Hurts Everyone Everywhere» (PDF). Retrieved December 9, 2006.
  93. ^ «Types, Values, and Variables». Sun Microsystems. Retrieved December 9, 2006.
  94. ^ Which programming languages are fastest? | Computer Language Benchmarks Game Archived August 14, 2011, at the Wayback Machine
  95. ^ speed ÷ C++ GNU g++ speed | Computer Language Benchmarks Game Archived September 26, 2011, at the Wayback Machine
  96. ^ «C++ vs Java performance; It’s a tie! | Blog of Christian Felde». Blog.cfelde.com. June 27, 2010. Retrieved February 9, 2016.
  97. ^ «Java Security Architecture: Contents». Docs.oracle.com. October 2, 1998. Retrieved February 9, 2016.
  98. ^ Horowitz, Michael (August 31, 2012). «Java security flaw: yada yada yada | Computerworld». Blogs.computerworld.com. Archived from the original on July 24, 2014. Retrieved February 9, 2016.
  99. ^ Brook, Chris. «The first stop for security news». Threatpost. Archived from the original on March 8, 2013. Retrieved February 9, 2016.
  100. ^ «Why and How to Disable Java on Your Computer Now — Technology & science — Innovation». NBC News. January 12, 2013. Retrieved February 9, 2016.
  101. ^ «US Department of Homeland Security Calls On Computer Users To Disable Java». Forbes.com. Retrieved February 9, 2016.
  102. ^ Brook, Chris. «The first stop for security news». Threatpost. Archived from the original on April 9, 2013. Retrieved February 9, 2016.
  103. ^ «Critical Patch Updates and Security Alerts». Oracle.com. Retrieved February 9, 2016.
  104. ^ Finkle, Jim (January 14, 2013). «Emergency patch for Java fails to fix cybercrime holes, warn experts». Independent.ie. Retrieved February 9, 2016.
  105. ^ Kelly, Meghan (January 14, 2013). «Oracle issues fix for Java exploit after DHS warns of its holes». VentureBeat. Retrieved February 9, 2016.
  106. ^ Krebs, Brian (February 16, 2016). «Good Riddance to Oracle’s Java Plugin». KrebsOnSecurity.
  107. ^ Gonsalves, Antone (September 5, 2012). «Java Is No Longer Needed. Pull The Plug-In». ReadWrite. Wearable World.
  108. ^ «Java: should you remove it?». The Guardian. February 8, 2013.
  109. ^ Bott, Ed. «A close look at how Oracle installs deceptive software with Java updates». ZDNet.com. ZDNet. Retrieved December 14, 2014.
  110. ^ «windows 7 — How do I update Java from a non-admin account?». Super User.
  111. ^ «Update Google Chrome — Computer — Google Chrome Help». support.google.com.
  112. ^ «Adobe Security Bulletin». helpx.adobe.com.

External links[edit]

Look up Java in Wiktionary, the free dictionary.

Spoken Wikipedia icon

This audio file was created from a revision of this article dated 19 August 2013, and does not reflect subsequent edits.

  • Official website Edit this at Wikidata
  • sun.com – Official developer site
  • «How The JVM Spec Came To Be». infoq.com. – Presentation by James Gosling about the origins of Java, from the JVM Languages Summit 2008
  • Java forums organization
  • Java Introduction, May 14, 2014, Java77 Blog
Java (software platform)

Dukesource125.gif

The Java technology logo

Original author(s) James Gosling, Sun Microsystems
Developer(s) Oracle Corporation
Initial release January 23, 1996; 27 years ago[1][2]
Stable release 19.0.1 (October 18, 2022; 3 months ago) [±]

17.0.5 LTS (October 18, 2022; 3 months ago) [±]
11.0.17 LTS (October 18, 2022; 3 months ago[3]) [±]

8u351 LTS (October 18, 2022; 3 months ago[4]) [±]

Written in Java, C++, C, assembly language[5]
Operating system Microsoft Windows, Linux, macOS,[6] and for old versions: Solaris
Platform x64, ARMv8, and for old versions: ARMv7, IA-32, SPARC (up to Java 14) (Java 8 includes 32-bit support for Windows – while no longer supported freely by Oracle for commercial use)[6]
Available in English, Chinese, French, German, Italian, Japanese, Korean, Portuguese, Spanish, Swedish[7]
Type Software platform
License Dual-license: GNU General Public License version 2 with classpath exception,[8] and a proprietary license.[9]
Website oracle.com/java/, java.com, dev.java

Java is a set of computer software and specifications developed by James Gosling at Sun Microsystems, which was later acquired by the Oracle Corporation, that provides a system for developing application software and deploying it in a cross-platform computing environment. Java is used in a wide variety of computing platforms from embedded devices and mobile phones to enterprise servers and supercomputers. Java applets, which are less common than standalone Java applications, were commonly run in secure, sandboxed environments to provide many features of native applications through being embedded in HTML pages.

Writing in the Java programming language is the primary way to produce code that will be deployed as byte code in a Java virtual machine (JVM); byte code compilers are also available for other languages, including Ada, JavaScript, Python, and Ruby. In addition, several languages have been designed to run natively on the JVM, including Clojure, Groovy, and Scala. Java syntax borrows heavily from C and C++, but object-oriented features are modeled after Smalltalk and Objective-C.[10] Java eschews certain low-level constructs such as pointers and has a very simple memory model where objects are allocated on the heap (while some implementations e.g. all currently supported by Oracle, may use escape analysis optimization to allocate on the stack instead) and all variables of object types are references. Memory management is handled through integrated automatic garbage collection performed by the JVM.

On November 13, 2006, Sun Microsystems made the bulk of its implementation of Java available under the GNU General Public License (GPL).[11][12]

The latest version is Java 19, released in September 2022, while Java 17, the latest long-term support (LTS), was released in September 2021. As an open source platform, Java has many distributors, including Amazon, IBM, Azul Systems, and AdoptOpenJDK. Distributions include Amazon Corretto, Zulu, AdoptOpenJDK, and Liberica. Regarding Oracle, it distributes Java 8, and also makes available e.g. Java 11, both also currently supported LTS versions. Oracle (and others) «highly recommend that you uninstall older versions of Java» than Java 8,[13] because of serious risks due to unresolved security issues.[14][15][16] Since Java 9 (as well as versions 10-16, and 18-19) are no longer supported, Oracle advises its users to «immediately transition» to a supported version. Oracle released the last free-for-commercial-use public update for the legacy Java 8 LTS in January 2019, and will continue to support Java 8 with public updates for personal use indefinitely. Oracle extended support for Java 6 ended in December 2018.[17]

Platform[edit]

The Java platform is a suite of programs that facilitate developing and running programs written in the Java programming language. A Java platform includes an execution engine (called a virtual machine), a compiler and a set of libraries; there may also be additional servers and alternative libraries that depend on the requirements. Java platforms have been implemented for a wide variety of hardware and operating systems with a view to enable Java programs to run identically on all of them. Different platforms target different classes of device and application domains:

  • Java Card: A technology that allows small Java-based applications (applets) to be run securely on smart cards and similar small-memory devices.
  • Java ME (Micro Edition): Specifies several different sets of libraries (known as profiles) for devices with limited storage, display, and power capacities. It is often used to develop applications for mobile devices, PDAs, TV set-top boxes, and printers.
  • Java SE (Standard Edition): For general-purpose use on desktop PCs, servers and similar devices.
  • Jakarta EE (Enterprise Edition): Java SE plus various APIs which are useful for multi-tier client–server enterprise applications.

The Java platform consists of several programs, each of which provides a portion of its overall capabilities. For example, the Java compiler, which converts Java source code into Java bytecode (an intermediate language for the JVM), is provided as part of the Java Development Kit (JDK). The Java Runtime Environment (JRE), complementing the JVM with a just-in-time (JIT) compiler, converts intermediate bytecode into native machine code on the fly. The Java platform also includes an extensive set of libraries.

The essential components in the platform are the Java language compiler, the libraries, and the runtime environment in which Java intermediate bytecode executes according to the rules laid out in the virtual machine specification.

Java virtual machine[edit]

The heart of the Java platform is the «virtual machine» that executes Java bytecode programs. This bytecode is the same no matter what hardware or operating system the program is running under. However, new versions, such as for Java 10 (and earlier), have made small changes, meaning the bytecode is in general only forward compatible. There is a JIT (Just In Time) compiler within the Java Virtual Machine, or JVM. The JIT compiler translates the Java bytecode into native processor instructions at run-time and caches the native code in memory during execution.

The use of bytecode as an intermediate language permits Java programs to run on any platform that has a virtual machine available. The use of a JIT compiler means that Java applications, after a short delay during loading and once they have «warmed up» by being all or mostly JIT-compiled, tend to run about as fast as native programs.[18][19][20]
Since JRE version 1.2, Sun’s JVM implementation has included a just-in-time compiler instead of an interpreter.

Although Java programs are cross-platform or platform independent, the code of the Java Virtual Machines (JVM) that execute these programs is not. Every supported operating platform has its own JVM.

Class libraries[edit]

In most modern operating systems (OSs), a large body of reusable code is provided to simplify the programmer’s job. This code is typically provided as a set of dynamically loadable libraries that applications can call at runtime. Because the Java platform is not dependent on any specific operating system, applications cannot rely on any of the pre-existing OS libraries. Instead, the Java platform provides a comprehensive set of its own standard class libraries containing many of the same reusable functions commonly found in modern operating systems. Most of the system library is also written in Java. For instance, the Swing library paints the user interface and handles the events itself, eliminating many subtle differences between how different platforms handle components.

The Java class libraries serve three purposes within the Java platform. First, like other standard code libraries, the Java libraries provide the programmer a well-known set of functions to perform common tasks, such as maintaining lists of items or performing complex string parsing. Second, the class libraries provide an abstract interface to tasks that would normally depend heavily on the hardware and operating system. Tasks such as network access and file access are often heavily intertwined with the distinctive implementations of each platform. The java.net and java.io libraries implement an abstraction layer in native OS code, then provide a standard interface for the Java applications to perform those tasks. Finally, when some underlying platform does not support all of the features a Java application expects, the class libraries work to gracefully handle the absent components, either by emulation to provide a substitute, or at least by providing a consistent way to check for the presence of a specific feature.

Languages[edit]

The word «Java», alone, usually refers to Java programming language that was designed for use with the Java platform. Programming languages are typically outside of the scope of the phrase «platform», although the Java programming language was listed as a core part of the Java platform before Java 7. The language and runtime were therefore commonly considered a single unit. However, an effort was made with the Java 7 specification to more clearly treat the Java language and the Java Virtual Machine as separate entities, so that they are no longer considered a single unit.[21]

Third parties have produced many compilers or interpreters that target the JVM. Some of these are for existing languages, while others are for extensions to the Java language. These include:

  • BeanShell – a lightweight scripting language for Java[22] (see also JShell)
  • Ceylon – an object-oriented, strongly statically typed programming language with an emphasis on immutability
  • Clojure – a modern, dynamic, and functional dialect of the Lisp programming language on the Java platform
  • Gosu – a general-purpose Java Virtual Machine-based programming language released under the Apache License 2.0
  • Groovy – a fully Java interoperable, Java-syntax-compatible, static and dynamic language with features from Python, Ruby, Perl, and Smalltalk
  • JRuby – a Ruby interpreter
  • Jython – a Python interpreter
  • Kotlin – an industrial programming language for JVM with full Java interoperability
  • Rhino – a JavaScript interpreter
  • Scala – a multi-paradigm programming language with non-Java compatible syntax designed as a «better Java»

Similar platforms[edit]

The success of Java and its write once, run anywhere concept has led to other similar efforts, notably the .NET Framework, appearing since 2002, which incorporates many of the successful aspects of Java. .NET was built from the ground-up to support multiple programming languages, while the Java platform was initially built to support only the Java language, although many other languages have been made for JVM since. Like Java, .NET languages compile to byte code and are executed by the Common
Language Runtime (CLR), which is similar in purpose to the JVM. Like the JVM, the CLR provides memory management through automatic garbage collection, and allows .NET byte code to run on multiple operating systems.

.NET included a Java-like language first named J++, then called Visual J# that was incompatible with the Java specification. It was discontinued 2007, and support for it ended in 2015.

Java Development Kit[edit]

The Java Development Kit (JDK) is a Sun product aimed at Java developers. Since the introduction of Java, it has been by far the most widely used Java software development kit (SDK).[citation needed] It contains a Java compiler, a full copy of the Java Runtime Environment (JRE), and many other important development tools.

Java Runtime Environment[edit]

The Java Runtime Environment (JRE) released by Oracle is a freely available software distribution containing a stand-alone JVM (HotSpot), the Java standard library (Java Class Library), a configuration tool, and—until its discontinuation in JDK 9—a browser plug-in. It is the most common Java environment installed on personal computers in the laptop and desktop form factor. Mobile phones including feature phones and early smartphones that ship with a JVM are most likely to include a JVM meant to run applications targeting Micro Edition of the Java platform. Meanwhile, most modern smartphones, tablet computers, and other handheld PCs that run Java apps are most likely to do so through support of the Android operating system, which includes an open source virtual machine incompatible with the JVM specification. (Instead, Google’s Android development tools take Java programs as input and output Dalvik bytecode, which is the native input format for the virtual machine on Android devices.)
The last Critical Path Update version of JRE with an Oracle BCL Agreement[23] was 8u201 and, the last Patch Set Update version with the same license was 8u202.[24][25] The last Oracle JRE implementation, regardless of its licensing scheme, was 9.0.4.[26]Since Java Platform SE 9, the whole platform also was grouped into modules.[27] The modularization of Java SE implementations allows developers to bundle their applications together with all the modules used by them, instead of solely relying on the presence of a suitable Java SE implementation in the user device.[28][29][30][31]

Performance[edit]

The JVM specification gives a lot of leeway to implementors regarding the implementation details. Since Java 1.3, JRE from Oracle contains a JVM called HotSpot. It has been designed to be a high-performance JVM.

To speed-up code execution, HotSpot relies on just-in-time compilation. To speed-up object allocation and garbage collection, HotSpot uses generational heap.

Generational heap[edit]

The Java virtual machine heap is the area of memory used by the JVM for dynamic memory allocation.[32]

In HotSpot the heap is divided into generations:

  • The young generation stores short-lived objects that are created and immediately garbage collected.
  • Objects that persist longer are moved to the old generation (also called the tenured generation). This memory is subdivided into (two) Survivors spaces where the objects that survived the first and next garbage collections are stored.

The permanent generation (or permgen) was used for class definitions and associated metadata prior to Java 8. Permanent generation was not part of the heap.[33][34] The permanent generation was removed from Java 8.[35]

Originally there was no permanent generation, and objects and classes were stored together in the same area. But as class unloading occurs much more rarely than objects are collected, moving class structures to a specific area allowed significant performance improvements.[33]

Security[edit]

Oracle’s JRE is installed on a large number of computers. End users with an out-of-date version of JRE therefore are vulnerable to many known attacks. This led to the widely shared belief that Java is inherently insecure.[36] Since Java 1.7, Oracle’s JRE for Windows includes automatic update functionality.

Before the discontinuation of the Java browser plug-in, any web page might have potentially run a Java applet, which provided an easily accessible attack surface to malicious web sites. In 2013 Kaspersky Labs reported that the Java plug-in was the method of choice for computer criminals. Java exploits are included in many exploit packs that hackers deploy onto hacked web sites.[37] Java applets were removed in Java 11, released on September 25, 2018.

History[edit]

The Java platform and language began as an internal project at Sun Microsystems in December 1990, providing an alternative to the C++/C programming languages. Engineer Patrick Naughton had become increasingly frustrated with the state of Sun’s C++ and C application programming interfaces (APIs) and tools, as well as with the way the NeWS project was handled by the organization. Naughton informed Scott McNealy about his plan of leaving Sun and moving to NeXT; McNealy asked him to pretend he was God and send him an e-mail explaining how to fix the company. Naughton envisioned the creation of a small team that could work autonomously without the bureaucracy that was stalling other Sun projects. McNealy forwarded the message to other important people at Sun, and the Stealth Project started.[38]

The Stealth Project was soon renamed to the Green Project, with James Gosling and Mike Sheridan joining Naughton. Together with other engineers, they began work in a small office on Sand Hill Road in Menlo Park, California. They aimed to develop new technology for programming next-generation smart appliances, which Sun expected to offer major new opportunities.[39]

The team originally considered using C++, but rejected it for several reasons. Because they were developing an embedded system with limited resources, they decided that C++ needed too much memory and that its complexity led to developer errors. The language’s lack of garbage collection meant that programmers had to manually manage system memory, a challenging and error-prone task. The team also worried about the C++ language’s lack of portable facilities for security, distributed programming, and threading. Finally, they wanted a platform that would port easily to all types of devices.

Bill Joy had envisioned a new language combining Mesa and C. In a paper called Further, he proposed to Sun that its engineers should produce an object-oriented environment based on C++. Initially, Gosling attempted to modify and extend C++ (a proposed development that he referred to as «C++ ++ —«) but soon abandoned that in favor of creating a new language, which he called Oak, after the tree that stood just outside his office.[40]

By the summer of 1992, the team could demonstrate portions of the new platform, including the Green OS, the Oak language, the libraries, and the hardware. Their first demonstration, on September 3, 1992, focused on building a personal digital assistant (PDA) device named Star7[1] that had a graphical interface and a smart agent called «Duke» to assist the user. In November of that year, the Green Project was spun off to become Firstperson, a wholly owned subsidiary of Sun Microsystems, and the team relocated to Palo Alto, California.[41] The Firstperson team had an interest in building highly interactive devices, and when Time Warner issued a request for proposal (RFP) for a set-top box, Firstperson changed their target and responded with a proposal for a set-top box platform. However, the cable industry felt that their platform gave too much control to the user, so Firstperson lost their bid to SGI. An additional deal with The 3DO Company for a set-top box also failed to materialize. Unable to generate interest within the television industry, the company was rolled back into Sun.

Java meets the Web[edit]

In June and July 1994 – after three days of brainstorming with John Gage (the Director of Science for Sun), Gosling, Joy, Naughton, Wayne Rosing, and Eric Schmidt – the team re-targeted the platform for the World Wide Web. They felt that with the advent of graphical web browsers like Mosaic the Internet could evolve into the same highly interactive medium that they had envisioned for cable TV. As a prototype, Naughton wrote a small browser, WebRunner (named after the movie Blade Runner), renamed HotJava[39] in 1995.

Sun renamed the Oak language to Java after a trademark search revealed that Oak Technology used the name Oak.[42] Sun priced Java licenses below cost to gain market share.[43] Although Java 1.0a became available for download in 1994, the first public release of Java, Java 1.0a2 with the HotJava browser, came on May 23, 1995, announced by Gage at the SunWorld conference. Accompanying Gage’s announcement, Marc Andreessen, Executive Vice President of Netscape Communications Corporation, unexpectedly announced that Netscape browsers would include Java support. On January 9, 1996, Sun Microsystems formed the JavaSoft group to develop the technology.[44]

While the so-called Java applets for web browsers no longer are the most popular use of Java (with it e.g. more used server-side) or the most popular way to run code client-side (JavaScript took over as more popular), it still is possible to run Java (or other JVM-languages such as Kotlin) in web browsers, even after JVM-support has been dropped from them, using e.g. TeaVM.

Version history[edit]

The Java language has undergone several changes since the release of JDK (Java Development Kit) 1.0 on January 23, 1996, as well as numerous additions of classes and packages to the standard library. Since J2SE 1.4 the Java Community Process (JCP) has governed the evolution of the Java Language. The JCP uses Java Specification Requests (JSRs) to propose and specify additions and changes to the Java platform. The Java Language Specification (JLS) specifies the language; changes to the JLS are managed under JSR 901.[45]

Sun released JDK 1.1 on February 19, 1997. Major additions included an extensive retooling of the AWT event model, inner classes added to the language, JavaBeans and JDBC.

J2SE 1.2 (December 8, 1998) – Codename Playground. This and subsequent releases through J2SE 5.0 were rebranded Java 2 and the version name «J2SE» (Java 2 Platform, Standard Edition) replaced JDK to distinguish the base platform from J2EE (Java 2 Platform, Enterprise Edition) and J2ME (Java 2 Platform, Micro Edition). Major additions included reflection, a collections framework, Java IDL (an interface description language implementation for CORBA interoperability), and the integration of the Swing graphical API into the core classes. A Java Plug-in was released, and Sun’s JVM was equipped with a JIT compiler for the first time.

J2SE 1.3 (May 8, 2000) – Codename Kestrel. Notable changes included the bundling of the HotSpot JVM (the HotSpot JVM was first released in April, 1999 for the J2SE 1.2 JVM), JavaSound, Java Naming and Directory Interface (JNDI) and Java Platform Debugger Architecture (JPDA).

J2SE 1.4 (February 6, 2002) – Codename Merlin. This became the first release of the Java platform developed under the Java Community Process as JSR 59.[46] Major changes included regular expressions modeled after Perl, exception chaining, an integrated XML parser and XSLT processor (JAXP), and Java Web Start.

J2SE 5.0 (September 30, 2004) – Codename Tiger. It was originally numbered 1.5, which is still used as the internal version number.[47] Developed under JSR 176, Tiger added several significant new language features including the for-each loop, generics, autoboxing and var-args.[48]

Java SE 6 (December 11, 2006) – Codename Mustang. It was bundled with a database manager and facilitates the use of scripting languages with the JVM (such as JavaScript using Mozilla’s Rhino engine). As of this version, Sun replaced the name «J2SE» with Java SE and dropped the «.0» from the version number.[49] Other major changes include support for pluggable annotations (JSR 269), many GUI improvements, including native UI enhancements to support the look and feel of Windows Vista, and improvements to the Java Platform Debugger Architecture (JPDA) & JVM Tool Interface for better monitoring and troubleshooting.

Java SE 7 (July 28, 2011) – Codename Dolphin. This version developed under JSR 336.[50] It added many small language changes including strings in switch, try-with-resources and type inference for generic instance creation. The JVM was extended with support for dynamic languages, while the class library was extended among others with a join/fork framework,[51] an improved new file I/O library and support for new network protocols such as SCTP. Java 7 Update 76 was released in January 2015, with expiration date April 14, 2015.[52]

In June 2016, after the last public update of Java 7,[53] «remotely exploitable» security bugs in Java 6, 7, and 8 were announced.[15]

Java SE 8 (March 18, 2014) – Codename Kenai. Notable changes include language-level support for lambda expressions (closures) and default methods, the Project Nashorn JavaScript runtime, a new Date and Time API inspired by Joda Time, and the removal of PermGen. This version is not officially supported on the Windows XP platform.[54] However, due to the end of Java 7’s lifecycle it is the recommended version for XP users. Previously, only an unofficial manual installation method had been described for Windows XP SP3. It refers to JDK8, the developing platform for Java that also includes a fully functioning Java Runtime Environment.[55] Java 8 is supported on Windows Server 2008 R2 SP1, Windows Vista SP2 and Windows 7 SP1, Ubuntu 12.04 LTS and higher (and some other OSes).[56]

Java SE 9 and 10 had higher system requirements, i.e. Windows 7 or Server 2012 (and web browser minimum certified is upped to Internet Explorer 11 or other web browsers), and Oracle dropped 32-bit compatibility for all platforms, i.e. only Oracle’s «64-bit Java virtual machines (JVMs) are certified».[57]

Java SE 11 was released September 2018, the first LTS release since the rapid release model was adopted starting with version 9. For the first time, OpenJDK 11 represents the complete source code for the Java platform under the GNU General Public License, and while Oracle still dual-licenses it with an optional proprietary license, there are no code differences nor modules unique to the proprietary-licensed version.[58] Java 11 features include two new garbage collector implementations, Flight Recorder to debug deep issues, a new HTTP client including WebSocket support.[59]

Java SE 12 was released March 2019.[60]

Java SE 13 was released September 2019.[61]

Java SE 14 was released March 2020.[62]

Java SE 15 was released September 2020.

Java SE 16 was released March 2021.

Java SE 17 was released September 2021.

Java SE 18 was released March 2022.

Java SE 19 was released September 2022.

In addition to language changes, significant changes have been made to the Java class library over the years, which has grown from a few hundred classes in JDK 1.0 to over three thousand in J2SE 5.0. Entire new APIs, such as Swing and Java 2D, have evolved, and many of the original JDK 1.0 classes and methods have been deprecated.

Usage[edit]

Desktop use[edit]

A Java program running on a Windows Vista desktop computer (supported by Java 8, but not officially by later versions, such as Java 11)

According to Oracle in 2010, the Java Runtime Environment was found on over 850 million PCs.[63] Microsoft has not bundled a Java Runtime Environment (JRE) with its operating systems since Sun Microsystems sued Microsoft for adding Windows-specific classes to the bundled Java runtime environment, and for making the new classes available through Visual J++.[citation needed] Apple no longer includes a Java runtime with OS X as of version 10.7, but the system prompts the user to download and install it the first time an application requiring the JRE is launched.[citation needed] Many Linux distributions include the OpenJDK runtime as the default virtual machine, negating the need to download the proprietary Oracle JRE.[64]

Some Java applications are in fairly widespread desktop use, including the NetBeans and Eclipse integrated development environments, and file sharing clients such as LimeWire and Vuze. Java is also used in the MATLAB mathematics programming environment, both for rendering the user interface and as part of the core system. Java provides cross platform user interface for some high end collaborative applications such as Lotus Notes.

Oracle plans to first deprecate the separately installable Java browser plugin from the Java Runtime Environment in JDK 9 then remove it completely from a future release, forcing web developers to use an alternative technology.[65]

Mascot[edit]

Duke is Java’s mascot.[66]

When Sun announced that Java SE and Java ME would be released under a free software license (the GNU General Public License), they released the Duke graphics under the free BSD license at the same time.[67] A new Duke personality is created every year.[68] For example, in July 2011 «Future Tech Duke» included a bigger nose, a jetpack, and blue wings.[69]

Licensing[edit]

The source code for Sun’s implementations of Java (i.e. the de facto reference implementation) has been available for some time, but until recently,[70] the license terms severely restricted what could be done with it without signing (and generally paying for) a contract with Sun. As such these terms did not satisfy the requirements of either the Open Source Initiative or the Free Software Foundation to be considered open source or free software, and Sun Java was therefore a proprietary platform.[71]

While several third-party projects (e.g. GNU Classpath and Apache Harmony) created free software partial Java implementations, the large size of the Sun libraries combined with the use of clean room methods meant that their implementations of the Java libraries (the compiler and VM are comparatively small and well defined) were incomplete and not fully compatible. These implementations also tended to be far less optimized than Sun’s.[citation needed]

Free software[edit]

Sun announced in JavaOne 2006 that Java would become free and open source software,[72] and on October 25, 2006, at the Oracle OpenWorld conference, Jonathan I. Schwartz said that the company was set to announce the release of the core Java Platform as free and open source software within 30 to 60 days.[73]

Sun released the Java HotSpot virtual machine and compiler as free software under the GNU General Public License on November 13, 2006, with a promise that the rest of the JDK (that includes the JRE) would be placed under the GPL by March 2007 («except for a few components that Sun does not have the right to publish in distributable source form under the GPL»).[74] According to Richard Stallman, this would mean an end to the «Java trap».[75] Mark Shuttleworth called the initial press announcement, «A real milestone for the free software community».[76]

Sun released the source code of the Class library under GPL on May 8, 2007, except some limited parts that were licensed by Sun from third parties who did not want their code to be released under a free software and open-source license.[77] Some of the encumbered parts turned out to be fairly key parts of the platform such as font rendering and 2D rasterising, but these were released as open-source later by Sun (see OpenJDK Class library).

Sun’s goal was to replace the parts that remain proprietary and closed-source with alternative implementations and make the class library completely free and open source. In the meantime, a third-party project called IcedTea created a completely free and highly usable JDK by replacing encumbered code with either stubs or code from GNU Classpath. However OpenJDK has since become buildable without the encumbered parts (from OpenJDK 6 b10[78]) and has become the default runtime environment for most Linux distributions.[79][80][81][82]

In June 2008, it was announced that IcedTea6 (as the packaged version of OpenJDK on Fedora 9) has passed the Technology Compatibility Kit tests and can claim to be a fully compatible Java 6 implementation.[83]

Because OpenJDK is under the GPL, it is possible to redistribute a custom version of the JRE directly with software applications,[84][85] rather than requiring the enduser (or their sysadmin) to download and install the correct version of the proprietary Oracle JRE onto each of their systems themselves.

Criticism[edit]

In most cases, Java support is unnecessary in Web browsers, and security experts recommend that it not be run in a browser unless absolutely necessary.[86] It was suggested that, if Java is required by a few Web sites, users should have a separate browser installation specifically for those sites.[citation needed]

Generics[edit]

When generics were added to Java 5.0, there was already a large framework of classes (many of which were already deprecated), so generics were chosen to be implemented using erasure to allow for migration compatibility and re-use of these existing classes. This limited the features that could be provided by this addition as compared to some other languages.[87][88] The addition of type wildcards made Java unsound.[89]

Unsigned integer types[edit]

Java lacks native unsigned integer types. Unsigned data are often generated from programs written in C and the lack of these types prevents direct data interchange between C and Java. Unsigned large numbers are also used in many numeric processing fields, including cryptography, which can make Java less convenient to use for these tasks.[90]
Although it is possible to partially circumvent this problem with conversion code and using larger data types, it makes using Java cumbersome for handling the unsigned data. While a 32-bit signed integer may be used to hold a 16-bit unsigned value with relative ease, a 32-bit unsigned value would require a 64-bit signed integer. Additionally, a 64-bit unsigned value cannot be stored using any integer type in Java because no type larger than 64 bits exists in the Java language. If abstracted using functions, function calls become necessary for many operations which are native to some other languages. Alternatively, it is possible to use Java’s signed integers to emulate unsigned integers of the same size, but this requires detailed knowledge of complex bitwise operations.[91]

Floating point arithmetic[edit]

While Java’s floating point arithmetic is largely based on IEEE 754 (Standard for Binary Floating-Point Arithmetic), certain features are not supported even when using the strictfp modifier, such as Exception Flags and Directed Roundings – capabilities mandated by IEEE Standard 754. Additionally, the extended precision floating-point types permitted in 754 and present in many processors are not permitted in Java.[92][93]

Performance[edit]

In the early days of Java (before the HotSpot VM was implemented in Java 1.3 in 2000) there were some criticisms of performance. Benchmarks typically reported Java as being about 50% slower than C (a language which compiles to native code).[94][95][96]

Java’s performance has improved substantially since the early versions.[18] Performance of JIT compilers relative to native compilers has in some optimized tests been shown to be quite similar.[18][19][20]

Java bytecode can either be interpreted at run time by a virtual machine, or it can be compiled at load time or runtime into native code which runs directly on the computer’s hardware. Interpretation is slower than native execution, and compilation at load time or runtime has an initial performance penalty for the compilation. Modern performant JVM implementations all use the compilation approach, so after the initial startup time the performance is equivalent to native code.

Security[edit]

The Java platform provides a security architecture[97] which is designed to allow the user to run untrusted bytecode in a «sandboxed» manner to protect against malicious or poorly written software. This «sandboxing» feature is intended to protect the user by restricting access to certain platform features and APIs which could be exploited by malware, such as accessing the local filesystem, running arbitrary commands, or accessing communication networks.

In recent years, researchers have discovered numerous security flaws in some widely used Java implementations, including Oracle’s, which allow untrusted code to bypass the sandboxing mechanism, exposing users to malicious attacks. These flaws affect only Java applications which execute arbitrary untrusted bytecode, such as web browser plug-ins that run Java applets downloaded from public websites. Applications where the user trusts, and has full control over, all code that is being executed are unaffected.

On August 31, 2012, Java 6 and 7 (both supported back then) on Microsoft Windows, OS X, and Linux were found to have a serious security flaw that allowed a remote exploit to take place by simply loading a malicious web page.[98] Java 5 was later found to be flawed as well.[99]

On January 10, 2013, three computer specialists spoke out against Java, telling Reuters that it was not secure and that people should disable Java. Jaime Blasco, Labs Manager with AlienVault Labs, stated that «Java is a mess. It’s not secure. You have to disable it.»[100]
This vulnerability affects Java 7 and it is unclear if it affects Java 6, so it is suggested that consumers disable it.[101][102] Security alerts from Oracle announce schedules of critical security-related patches to Java.[103]

On January 14, 2013, security experts said that the update still failed to protect PCs from attack.[104] This exploit hole prompted a response from the United States Department of Homeland Security encouraging users to disable or uninstall Java.[16] Apple blacklisted Java in limited order for all computers running its OS X operating system through a virus protection program.[105]

In 2014 and responding to then-recent Java security and vulnerability issues, security blogger Brian Krebs has called for users to remove at least the Java browser plugin and also the entire software. «I look forward to a world without the Java plugin (and to not having to remind readers about quarterly patch updates) but it will probably be years before various versions of this plugin are mostly removed from end-user systems worldwide.»[106] «Once promising, it has outlived its usefulness in the browser, and has become a nightmare that delights cyber-criminals at the expense of computer users.»[107] «I think everyone should uninstall Java from all their PCs and Macs, and then think carefully about whether they need to add it back. If you are a typical home user, you can probably do without it. If you are a business user, you may not have a choice.»[108]

Adware[edit]

The Oracle-distributed Java runtime environment has a history of bundling sponsored software to be installed by default during installation and during the updates which roll out every month or so. This includes the «Ask.com toolbar» that will redirect browser searches to ads and «McAfee Security Scan Plus».[109] These offers can be blocked through a setting in the Java Control Panel, although this is not obvious. This setting is located under the «Advanced» tab in the Java Control Panel, under the «Miscellaneous» heading, where the option is labelled as an option to suppress «sponsor offers».

Update system[edit]

Java has yet to release an automatic updater that does not require user intervention and administrative rights[110] unlike Google Chrome[111] and Flash player.[112]

See also[edit]

  • List of Java APIs
  • Java logging frameworks
  • Java performance
  • JavaFX
  • Jazelle
  • Java ConcurrentMap
  • Comparison of the Java and .NET platforms
  • List of JVM languages
  • List of computing mascots

References[edit]

  1. ^ «JavaSoft ships Java 1.0» (Press release). Archived from the original on February 5, 2008. Retrieved February 9, 2016.
  2. ^ Ortiz, C. Enrique; Giguère, Éric (2001). Mobile Information Device Profile for Java 2 Micro Edition: Developer’s Guide (PDF). John Wiley & Sons. ISBN 978-0471034650. Retrieved May 30, 2012.
  3. ^ «JDK Releases». Oracle Corporation. Retrieved December 9, 2022.
  4. ^ «JDK Releases». Oracle Corporation. Retrieved December 9, 2022.
  5. ^ «HotSpot Group». Openjdk.java.net. Retrieved February 9, 2016.
  6. ^ a b «Oracle JDK 8 and JRE 8 Certified System Configurations Contents». Oracle.com. April 8, 2014. Retrieved February 9, 2016.
  7. ^ «Java SE 7 Supported Locales». Oracle.com. Retrieved February 9, 2016.
  8. ^ «OpenJDK: GPLv2 + Classpath Exception». Openjdk.java.net. April 1, 1989. Retrieved February 9, 2016.
  9. ^ «BCL For Java SE». Oracle.com. April 2, 2013. Retrieved February 9, 2016.
  10. ^ Naughton, Patrick. «Java Was Strongly Influenced by Objective-C». Virtual School. Archived from the original on August 13, 2012.
  11. ^ «Sun Opens Java». Sun Microsystems. November 13, 2006. Archived from the original on May 13, 2008.
  12. ^ O’Hair, Kelly (December 2010). «OpenJDK7 and OpenJDK6 Binary Plugs Logic Removed». Oracle Corporation. Retrieved November 25, 2011.
  13. ^ «Why should I uninstall older versions of Java from my system?». www.java.com. Archived from the original on February 12, 2018. Retrieved February 6, 2018.
  14. ^ «Why should I uninstall older versions of Java from my system?». Oracle. Retrieved September 9, 2016.
  15. ^ a b «Oracle Critical Patch Update — July 2016». www.oracle.com.
  16. ^ a b Whittaker, Zack (January 11, 2013). «Homeland Security warns to disable Java amid zero-day flaw». ZDNet. Retrieved February 9, 2016.
  17. ^ Alexander, Christopher. «Java SE 6 Advanced». www.oracle.com. Retrieved May 20, 2018.
  18. ^ a b c Lewis, J. P.; Neumann, Ulrich. «Performance of Java versus C++». Graphics and Immersive Technology Lab, University of Southern California.
  19. ^ a b «The Java Faster than C++ Benchmark». Kano.net. November 14, 2003. Retrieved February 9, 2016.
  20. ^ a b FreeTTS – A Performance Case Study Archived 2009-03-25 at the Wayback Machine, Willie Walker, Paul Lamere, Philip Kwok
  21. ^ «Chapter 1. Introduction». docs.oracle.com.
  22. ^ www.beanshell.org
  23. ^ https://www.oracle.com/downloads/licenses/binary-code-license.html[dead link]
  24. ^ «Java CPU and PSU Releases Explained». Archived from the original on November 3, 2014.
  25. ^ https://www.oracle.com/java/technologies/javase/javase8-archive-downloads.html[dead link]
  26. ^ https://www.oracle.com/java/technologies/javase/javase9-archive-downloads.html[dead link]
  27. ^ https://www.oracle.com/corporate/features/understanding-java-9-modules.html[dead link]
  28. ^ «Java Modules».
  29. ^ «Java 9 Structural Changes in the JDK and JRE». October 30, 2017.
  30. ^ «IBM Developer».
  31. ^ «A Guide to Java 9 Modularity | Baeldung». April 18, 2018.
  32. ^ «Frequently Asked Questions about Garbage Collection in the Hotspot Java Virtual Machine». Sun Microsystems. February 6, 2003. Retrieved February 7, 2009.
  33. ^ a b Masamitsu, Jon (November 28, 2006). «Presenting the Permanent Generation». Archived from the original on August 25, 2016. Retrieved February 7, 2009.
  34. ^ Nutter, Charles (September 11, 2008). «A First Taste of InvokeDynamic». Retrieved February 7, 2009.
  35. ^ «JEP 122: Remove the Permanent Generation». Oracle Corporation. December 4, 2012. Retrieved March 23, 2014.
  36. ^ «What Is Java, Is It Insecure, and Should I Use It?». Lifehacker.com. January 14, 2013. Retrieved June 26, 2015.
  37. ^ «Is there any protection against Java exploits? | Kaspersky Lab». Kaspersky.com. September 9, 2013. Archived from the original on April 4, 2015. Retrieved June 26, 2015.
  38. ^ Southwick, Karen (1999). High Noon: the inside story of Scott McNealy and the rise of Sun Microsystems. New York [u.a.]: Wiley. pp. 120–122. ISBN 0471297135.
  39. ^ a b Byous, Jon (April 2003). «Java Technology: The Early Years». Sun Microsystems. Archived from the original on May 30, 2008. Retrieved August 2, 2009.
  40. ^ Southwick, Karen (1999). High Noon: the inside story of Scott McNealy and the rise of Sun Microsystems. New York [u.a.]: Wiley. p. 124. ISBN 0471297135.
  41. ^
    Walrath, Kathy (December 21, 2001). «Foreword». Sun Microsystems. Retrieved August 2, 2009.
  42. ^ Murphy, Kieron (4 October 1996). «So why did they decide to call it Java?». JavaWorld. Retrieved 2020-07-15. ‘The lawyers had told us that we couldn’t use the name «OAK» because [it was already trademarked by] Oak Technologies,’ said Frank Yellin, a senior engineer at Sun. ‘So a brainstorming session was held to come up with ideas for a new name.’
  43. ^ Bank, David (December 1, 1995). «The Java Saga». Wired. Retrieved October 4, 2022. ‘It’s priced below our cost,’ Schmidt says. ‘This loses money in the licensing business for the foreseeable future. It’s a strategic investment in market share.’
  44. ^ «Sun Microsystems announces formation of JavaSoft» (Press release). Sun Microsystems. 9 January 1996. Archived from the original on 2008-02-10.
  45. ^ «The Java Community Process(SM) Program — JSRs: Java Specification Requests — detail JSR# 63». Jcp.org. Retrieved February 9, 2016.
  46. ^ «The Java Community Process(SM) Program — JSRs: Java Specification Requests — detail JSR# 59». Jcp.org. Retrieved February 9, 2016.
  47. ^ «Version 1.5.0 or 5.0?». Java.sun.com. Retrieved February 9, 2016.
  48. ^ «The Java Community Process(SM) Program — JSRs: Java Specification Requests — detail JSR# 176». Jcp.org. Retrieved February 9, 2016.
  49. ^ «Java Naming». Java.com. Oracle. Retrieved August 25, 2011.
  50. ^ «The Java Community Process(SM) Program — JSRs: Java Specification Requests — detail JSR# 336». Jcp.org. Retrieved February 9, 2016.
  51. ^ Lea, Doug (September 13, 2004). «JSRs: Java Specification Requests: JSR 166: Concurrency Utilities». Java Community Process. Oracle Corp.
  52. ^ «Java™ SE Development Kit 7 Update 76 Release Notes». Oracle.com. Retrieved February 9, 2016.
  53. ^ «Java 7 and Java 8 Releases by Date». www.java.com.
  54. ^ «Windows XP and Java». Java.com. April 8, 2014. Retrieved February 9, 2016.
  55. ^ «java — installing JDK8 on Windows XP — advapi32.dll error». Stack Overflow.
  56. ^ «Oracle JDK 8 and JRE 8 Certified System Configurations». www.oracle.com.
  57. ^ «Oracle JDK 10 Certified System Configurations». www.oracle.com. Retrieved March 27, 2018. Only X.org Mode supported. Wayland mode is unsupported.
  58. ^ «Oracle Java SE Support Roadmap». Oracle Corporation. September 25, 2018. Retrieved September 25, 2018.
  59. ^ «JDK 11». Oracle Corporation. September 25, 2018. Retrieved September 26, 2018.
  60. ^ «JDK 12». OpenJDK. Retrieved March 22, 2019.
  61. ^ «JDK 13». OpenJDK. Retrieved September 17, 2019.
  62. ^ «JDK 14». OpenJDK. Retrieved March 25, 2020.
  63. ^ «What is Java technology and why do I need it?». Archived from the original on September 25, 2010. Retrieved December 15, 2011. Java runs on more than 850 million personal computers worldwide, and on billions of devices worldwide, including mobile and TV devices.
  64. ^ «Java — Fedora Project Wiki». fedoraproject.org.
  65. ^ Topic, Dalibor (January 27, 2016). «Moving to a plugin-free web». Oracle.
  66. ^ «Duke, the Java Mascot». Oracle. Retrieved March 18, 2019.
  67. ^ «duke: Project Home Page». Sun Microsystems. Archived from the original on June 18, 2007. Retrieved March 18, 2007.
  68. ^ «Duke, the Java Mascot».
  69. ^ «Future Tech Duke (The Java Source)». Tori Wieldt. Archived from the original on August 20, 2011. Retrieved August 17, 2011.
  70. ^ Smith, Donald (September 11, 2018). «Oracle JDK Releases for Java 11 and Later».
  71. ^ Stallman, Richard (May 24, 2006). «The Curious Incident of Sun in the Night-Time». Groklaw.
  72. ^ Schwartz, Jonathan. «?». Jonathan Schwartz’s Blog. Sun Microsystems. Archived from the original on July 15, 2006.
  73. ^ «Oracle OpenWorld: UnBreakable Linux / 5015.2 not on the horizon | Formtek Blog». Formtek.com. October 26, 2006. Retrieved February 9, 2016.
  74. ^ «Oracle and Sun Microsystems | Strategic Acquisitions | Oracle». Sun.com. Retrieved February 9, 2016.
  75. ^ «Free but Shackled — The Java Trap — GNU Project — Free Software Foundation». Gnu.org. April 12, 2004. Retrieved February 9, 2016.
  76. ^ «Sun ‘releases’ Java to the World». BBC News. November 13, 2006. Retrieved May 6, 2010.
  77. ^ «Open JDK is here!». Sun Microsystems. May 8, 2007. Retrieved May 9, 2007.
  78. ^ Wielaard, Mark (May 30, 2007). «OpenJDK6 b10 source posted». Retrieved July 12, 2008.
  79. ^ «Redhat Java».
  80. ^ «Fedora Java».
  81. ^ «Debian Java».
  82. ^ «Ubuntu Java».
  83. ^ Sharples, Rich (June 19, 2008). «Java is finally Free and Open». Archived from the original on June 20, 2008.
  84. ^ libgdx (December 9, 2013). «Bundling a jre · libgdx/libgdx Wiki · GitHub». Github.com. Retrieved February 9, 2016.
  85. ^ «Question about bundling custom OpenJDK». Java-Gaming.org. Archived from the original on March 4, 2016. Retrieved February 9, 2016.
  86. ^ Cluley, Graham (January 15, 2013). ««Unless it is absolutely necessary to run Java in web browsers, disable it», DHS-sponsored CERT team says – Naked Security». Nakedsecurity.sophos.com. Retrieved February 9, 2016.
  87. ^ «Generics in Java». Object Computing, Inc. Archived from the original on January 2, 2007. Retrieved December 9, 2006.
  88. ^ «What’s Wrong With Java: Type Erasure». December 6, 2006. Retrieved December 9, 2006.
  89. ^ «Java and Scala’s Type Systems are Unsound» (PDF).
  90. ^
    «Java libraries should provide support for unsigned integer arithmetic». Bug Database, Sun Developer Network. Oracle. Retrieved January 18, 2011.
  91. ^ Owens, Sean R. (November 5, 2009). «Java and unsigned int, unsigned short, unsigned byte, unsigned long, etc. (Or rather, the lack thereof)». darksleep.com. Retrieved October 9, 2010.
  92. ^ Kahan, W.; Darcy, Joseph D. (March 1, 1998). «How Java’s Floating-Point Hurts Everyone Everywhere» (PDF). Retrieved December 9, 2006.
  93. ^ «Types, Values, and Variables». Sun Microsystems. Retrieved December 9, 2006.
  94. ^ Which programming languages are fastest? | Computer Language Benchmarks Game Archived August 14, 2011, at the Wayback Machine
  95. ^ speed ÷ C++ GNU g++ speed | Computer Language Benchmarks Game Archived September 26, 2011, at the Wayback Machine
  96. ^ «C++ vs Java performance; It’s a tie! | Blog of Christian Felde». Blog.cfelde.com. June 27, 2010. Retrieved February 9, 2016.
  97. ^ «Java Security Architecture: Contents». Docs.oracle.com. October 2, 1998. Retrieved February 9, 2016.
  98. ^ Horowitz, Michael (August 31, 2012). «Java security flaw: yada yada yada | Computerworld». Blogs.computerworld.com. Archived from the original on July 24, 2014. Retrieved February 9, 2016.
  99. ^ Brook, Chris. «The first stop for security news». Threatpost. Archived from the original on March 8, 2013. Retrieved February 9, 2016.
  100. ^ «Why and How to Disable Java on Your Computer Now — Technology & science — Innovation». NBC News. January 12, 2013. Retrieved February 9, 2016.
  101. ^ «US Department of Homeland Security Calls On Computer Users To Disable Java». Forbes.com. Retrieved February 9, 2016.
  102. ^ Brook, Chris. «The first stop for security news». Threatpost. Archived from the original on April 9, 2013. Retrieved February 9, 2016.
  103. ^ «Critical Patch Updates and Security Alerts». Oracle.com. Retrieved February 9, 2016.
  104. ^ Finkle, Jim (January 14, 2013). «Emergency patch for Java fails to fix cybercrime holes, warn experts». Independent.ie. Retrieved February 9, 2016.
  105. ^ Kelly, Meghan (January 14, 2013). «Oracle issues fix for Java exploit after DHS warns of its holes». VentureBeat. Retrieved February 9, 2016.
  106. ^ Krebs, Brian (February 16, 2016). «Good Riddance to Oracle’s Java Plugin». KrebsOnSecurity.
  107. ^ Gonsalves, Antone (September 5, 2012). «Java Is No Longer Needed. Pull The Plug-In». ReadWrite. Wearable World.
  108. ^ «Java: should you remove it?». The Guardian. February 8, 2013.
  109. ^ Bott, Ed. «A close look at how Oracle installs deceptive software with Java updates». ZDNet.com. ZDNet. Retrieved December 14, 2014.
  110. ^ «windows 7 — How do I update Java from a non-admin account?». Super User.
  111. ^ «Update Google Chrome — Computer — Google Chrome Help». support.google.com.
  112. ^ «Adobe Security Bulletin». helpx.adobe.com.

External links[edit]

Look up Java in Wiktionary, the free dictionary.

Spoken Wikipedia icon

This audio file was created from a revision of this article dated 19 August 2013, and does not reflect subsequent edits.

  • Official website Edit this at Wikidata
  • sun.com – Official developer site
  • «How The JVM Spec Came To Be». infoq.com. – Presentation by James Gosling about the origins of Java, from the JVM Languages Summit 2008
  • Java forums organization
  • Java Introduction, May 14, 2014, Java77 Blog

Краткий гайд для начинающих Java-разработчиков. Поговорим об одном из популярнейших языков программирования, выясним, чем он так примечателен, почему многие хотят его изучать в качестве первого языка, какие программы можно создавать с помощью Java и где его учить. 

Что такое Java?

Java – это язык программирования общего назначения. То есть язык, который применяется в разработке различных программных продуктов, без четкой специализации в конкретной сфере. Он во многом похож на Python, JavaScript и другие языки того же уровня, что и Java. Кроме того, Java заимствует массу синтаксических конструкций из C и C++. 

Это объектно-ориентированный язык. Вся структура строится вокруг объектов, классов, инстансов и прочих формальных сущностей, принятых в сообществе программистов за стандарт разработки ООП. Это как проектирование домов с использованием отдельных строительных блоков, которые потом можно задействовать при постройке различных типов зданий. Программы, написанные на Java, состоят из подобных «блоков», что сокращает время разработки, а также делает код более читаемым и удобным для модификации. 

А еще Java выступает в роли платформы. Код, написанный на этом языке, запускается в виртуальной машине JVM и без проблем инициализируются в любой системе, где поддерживается соответствующая виртуальная машина. 

История появления Java

Язык Java был разработан командой инженеров Sun Microsystems в 1995 году. Позднее компания вместе с Java была поглощена корпорацией Oracle. 

Ключевой задачей при разработке Java было создать язык программирования, который мог бы запускаться не только на компьютерах. То есть был достаточно универсальным, чтобы работать даже на операционной системе холодильника. На момент разработки такое решение казалось чересчур дальновидным, но оно привнесло вместе с собой несколько важных архитектурных изменений, ставших критически важными для Java и сделавших этот язык популярным. 

Например, язык позволял написать код единожды и без изменений скомпилировать его под любое стороннее ПО. Это сильно упрощало разработку и, что важнее, сокращало количество человеко-часов, требуемых для написания кода. 

Пример Java-кода

Правда, популярность Java принесла не эта особенность, а возможность создавать мини-приложения для веб-страниц. Раньше без Java многие сайты или их функции оставались недоступными, и девелоперам приходилось скачивать утилиту JRE, чтобы все работало, как и задумывалось. 

Java и JavaScript 

У начинающих разработчиков и обывателей иногда складывается мнение, что эти языки связаны, но это не так. Из общего у них 4 буквы в названии и синтаксис на базе C.

JavaScript был разработан компанией Netscape в середине 90-х годов и изначально назывался LiveScript. Язык не сыскал популярности, потому что все внимание на тот момент уделялось бурно растущему Java. Поэтому Netscape решили сделать ребрендинг, чтобы хоть кто-то заинтересовался их детищем. И, как ни странно, это сработало. 

Сейчас это один из краеугольных камней веба с десятками мощных фреймворков. Кстати, схожесть в синтаксисе дает разработчикам возможность быстрее перейти с одного языка на другой. Если знаете Java, то быстрее освоите JavaScript и наоборот. 

Комьюнити теперь в Телеграм

Подпишитесь и будьте в курсе последних IT-новостей

Подписаться

Какие программы можно писать на Java

В общем-то, любые. Java тем и хорош, что это язык общего назначения – уже в базовой комплектации он подходит для разработки под целый арсенал программных платформ. Нужен виджет для веба? Java подходит. Нужно сделать универсальное приложение для Windows, Linux и macOS? Не проблема. Разрабатывать под Android тоже можно. 

Сценариев использования Java много. Язык действительно универсален и подходит для разработки любого ПО под любое ПО. Поэтому лучшим ответом на вопрос, какие программы можно писать на Java, будет – те, что вы сами захотите создать.

Java и Android

Исторически сложилось так, что Java стал одним из флагманских языков для разработки под Android. Виртуальные машины, встроенные в мобильную операционную систему Google, позволяют инициализировать Java-код. По этой причине внушительное количество ПО, созданного для Android, было написано на языке Sun Microsystems. 

Сейчас есть и другие языки для создания приложений под Android, но Java все еще остается одним из наиболее популярных.

Примеры лучших программ, написанных на Java

  • В 2004 году инженеры NASA использовали утилиту Maestro Science Activity Planner, написанную на Java, для управления ровером Spirit, пока тот бороздил просторы «красной» планеты. Интерфейс приложения для управления ровером

  • Уже на протяжении 20 лет специалисты в сфере космической отрасли используют JavaFX Deep Space Trajectory Explorer для навигации за пределами Земли. 

  • Поиск, встроенный в самую популярную веб-энциклопедию (Википедию), был изначально написан на Java, а потом заменен на Elasticsearch, движок, который тоже основан на Java. 

  • Одна из популярнейших игр – Minecraft – была создана Марком Перссоном в 2009 году и написана на Java. На этом же языке пишутся различные модификации и дополнения к игре.

  • IntelliJ IDEA – универсальная, продвинутая среда разработки тоже основана на Java.

И таких примеров масса. Java-приложения используются астронавтами, инженерами, медиками, системными администраторами и т.д. Практически любую сферу деятельности этот язык так или иначе затронул. 

Плюсы Java

Почему вам стоит изучать Java? Чем он все-таки так хорош и как получил столь широкую популярность в сообществе разработчиков?

  1. Он легок в освоении. Большая часть синтаксиса заимствована из C++, но в его усовершенствованной форме. Создатели Java устранили все противоречивые моменты. В итоге получился C++, который не только достаточно мощный и универсальный, но и удобный. 

  2. Java – стабильный и надежный язык. Его объектно-ориентированная природа позволяет избежать фатальных ошибок при разработке, возникающих по вине программистов. 

  3. Безопасность тоже не на последнем месте. Создавая Java, специалисты из Sun Microsystems уже задумывались об использовании языка для создания мобильных приложений, которые будут коммуницировать через интернет. Поэтому уже на этапе проектирования они задались целью сделать Java настолько безопасным, насколько это возможно. 

  4. Ну и главное – полная независимость от выбранной платформы. Как я уже говорил выше, Java может использоваться для разработки под любую операционную систему. 

Минусы Java

Выделить недостатки языка так же четко, как и преимущества, гораздо сложнее. Минусы довольно расплывчатые. Первое, что приходит на ум – порог вхождения. Да, я упомянул ранее, что Java похож на JavaScript, но начать изучать второй гораздо проще. Java, несмотря на огромное сообщество поклонников и безумную популярность, все еще дается новичкам сложнее.

Java создавался для решения относительно комплексных задач. Поэтому использовать его для написания небольших скриптов не рекомендуется. Это как вспахивать грядку на небольшом дачном участке с помощью промышленного комбайна. Можно, но зачем? 

А еще из-за того, что весь код запускается в виртуальных машинах, Java сложнее оптимизировать. Поэтому производительность Java-приложений временами может ощутимо снижаться. В частности, это было заметно на ранних этапах развития Android. Тогда он заработал себе репутацию вечно зависающего и до жути медлительного продукта. Всему виной был Java. 

Похожие языки

Из близких родственников Java можно выделить популярный язык программирования С#. Близки они настолько, что некоторые школы, выпускают Java-программистов, которые впоследствии устраиваются на позицию C#-разработчика. И дело не только в подходе к обучению на подобных курсах, а в технических схожестях. И это неудивительно, потому что язык Microsoft создавался с оглядкой на Java.

Поэтому С# используется для решения тех же задач, для которых изначально создавался Java. В целом, можно даже считать их взаимозаменяемыми. 

Java против Python

Главное преимущество Python – его простой синтаксис. Действительно, написать простой скрипт или опробовать новую идею в среде Python куда проще. Не нужно писать и компилировать целую программу, чтобы добиться результата. 

Это проявляется при работе с любыми сущностями кода. Те же классы в Python и Java выглядят по-разному. В последнем они заметно массивнее и сложнее в понимании, чем те, что предлагает Python.

В отличие от Python, в Java используется строгая типизация, что вынуждает разработчиков быть дисциплинированными и всегда заранее декларировать используемый тип данных. В противном случае компилятор отзовется ошибкой. Python в этом плане менее придирчив.

А еще Python поддерживает больше вариантов оформления кода, поэтому большинство разработчиков считает, что его проще читать. 

Java против C++

Несмотря на наличие общих черт между этими языками в части синтаксиса, у Java и C++ есть ряд значимых отличий. 

К примеру, С++ использует только компилятор. То есть механизм, преобразующий весь код в объектную структуру, напрямую прочитываемую компьютером. Java же, помимо компилятора, задействует интерпретатор, читающий каждую строку и сразу выполняющий инструкции, в ней описанные.

С++ поддерживает перезагрузку операторов и перегрузку методов, а также такие типы, как struct и union. Из вышеперечисленного Java поддерживает только перегрузку методов. 

С++ чаще используется для создания музыкального программного обеспечения, например секвенсоров или эмуляторов аналогового оборудования. Также С++ код можно обнаружить в компонентах операционных систем Windows и macOS.

Многие разработчики сравнивают С++ и Java в пользу второго, потому что он имеет схожие возможности, но не содержит в себе недостатков первого. 

Насколько востребован Java?

Если ввести на HH.ru запрос «Java», то по всей России найдется 10 с лишним тысяч вакансий. За рубежом найдется в разы больше предложений. Так что спрос на Java-разработчиков есть. Это я к тому, что начав учить язык, не нужно переживать, что потом не получится найти работу со стабильным доходом. Если станете хорошим специалистом, то однозначно получится. Минимальная зарплата – от 100 000 рублей. 

Ноутбук с запущенной средой разработки Сотрудники требуются в банковские организации (много вакансий от Сбера), в стартапы всех мастей, включая AR/VR-проекты. Даже в крупные зарубежные компании зовут, и платят от полумиллиона рублей, предоставляя кучу других бонусов. 

Сложно ли научиться Java с нуля?

Зависит от формата обучения, конечно. Изучать все самостоятельно может быть сложно. Для тех, кто не разбирается в программировании, есть сотни курсов и адаптированных под новичков обучающих программ. Лучше уж заплатить деньги какому-нибудь Skillbox или попросить льготы на Coursera, чем возиться самому, не зная, к какому источнику знаний примкнуть. 

Для тех, кто уже пишет на другом языке, есть масса литературы и огромное лояльное сообщество поклонников Java. Выучить все самостоятельно не составит труда, тем более если до этого вы писали на C++, JavaScript или C#.

Откуда-то новые разработчики на Java постоянно берутся. Значит, выучить язык и начать делать на нем приложения – вполне себе подъемная задача. Вы тоже справитесь. 

Где изучать Java?

Вариантов масса:

  • Skillbox – школа, выдающая дипломы государственного образца. Здесь учат разным специальностям, в том числе и интересующей нас. Берут много денег, но зато обещают видимый результат. 

  • Coursera – международная школа обучения любым дисциплинам. Здесь много курсов по программированию, в том числе по языку Java, от лучших университетов планеты. 

  • JavaRush – специализированный онлайн-курс для тех, кому больше по душе интерактивная система обучения. 

Также стоит опробовать другие сайты и приложения для обучения программированию, о которых я писал ранее.

Вместо заключения

Пробуйте разные языки программирования, если не уверены, что хотите изучать Java. Осознание придет после приобретения опыта работы в коммерческой разработке. К тому же «прыгать» с одного языка на другой легче, если умеешь писать код хотя бы на одном. Но если решились на Java, то точно не пожалеете. Он умеет все и гарантированно дает массу фундаментальных знаний, которые помогут стать хорошим специалистом в любой области разработки.

Если вы увидели Java в списке установленных программ, но не знаете, зачем она нужна – эта статья для вас. Многие пользователи спрашивают, зачем нужна Java на компьютере или ноутбуке, как она установилась, и что она делает. Давайте разбираться.

Java – это бесплатная платформа, которая предназначена для запуска приложений, написанных на одноименном языке программирования Java. Многие программы и веб-приложения работают на Java. Что из себя представляет эта платформа?

На компьютеры обычных пользователей чаще всего устанавливается JRE – Java Runtime Environment. Грубо говоря, это контейнер, внутри которого запускаются и работают Java программы. Он обеспечивает безопасность, стабильность и окружение для некоторой части софта на вашем компьютере.

Раньше Java активно использовали для написания “апплетов” – небольших приложений, работающих прямо в браузере. Например календарь, гостевая книга или онлайн чат. Сейчас для этих целей используется JavaScript, который не требует наличия установленной Java. Но все же много сайтов в бездонном Интернете работают на этой технологии. И если у вас нет Java, тогда такие сайты не смогут корректно работать и вы не сможете взаимодействовать с ними. Сайт не реагирует на ваши действия? Возможно причина кроется в отсутствии Java.

Более широко Java использовали и используют для создания настольных приложений. Потому некоторые программы просто не смогут работать без установленной Java. Например, популярная игра Minecraft работает исключительно внутри виртуальной “машины” Java. А если вы занимаетесь программированием, то для запуска некоторых IDE (сред для разработки ПО) тоже нужна Java.

Откуда Java на моем компьютере?

Java часто устанавливается сразу после установки Windows или другой ОС как служебная программа. Возможно ее установил человек, который ставил вам Windows, или она была предустановлена на вашем ПК или ноутбуке. Или некоторое приложение, требующее Java, установило ее на ПК. Просто знайте, это вовсе не вредоносное приложение, и удалять его во время чистки компьютера не нужно. Не зря мы включили Java в список нужных программ для Windows.

Время от времени вы можете видеть уведомления с предложением обновить Java. С каждым таким обновлением платформа Java улучшается, устраняются уязвимости и исправляются ошибки. Рекомендую соглашаться и обновлять ее. Это касается и другого ПО – периодически обновляйте антивирусы, программы, которыми пользуетесь, и операционную систему. Теперь вы знаете, зачем нужна Java на ПК, и что она делает.

Руководство по Java для начинающих | Microsoft Azure

Что такое Java?

Java — это многоплатформенный объектно-ориентированный язык программирования, работающий на миллиардах устройств по всему миру. На нем работают приложения, операционные системы для смартфонов, корпоративное программное обеспечение и многие известные программы. Несмотря на то, что Java был изобретен более 20 лет назад, в настоящее время он является самым популярным языком программирования среди разработчиков приложений.

Вот признаки, которые определили Java и сделали его таким популярным. Java:

Мультиплатформенность: Java была отмечена лозунгом «напиши один раз, работай где угодно» (или WORA), который остается актуальным и сегодня. Код Java, написанный для одной платформы, такой как операционная система Windows, может быть легко перенесен на другую платформу, например ОС мобильного телефона, и наоборот без полной перезаписи. Java работает на нескольких платформах, поскольку при компиляции Java-программы компилятор создает файл байт-кода .class, который может работать в любой операционной системе, на которой установлена виртуальная машина Java (JVM). Как правило, JVM легко установить в большинстве основных операционных систем, включая iOS, что не всегда было так.

Объектно-ориентированный: Java был одним из первых объектно-ориентированных языков программирования. Объектно-ориентированный язык программирования организует свой код вокруг классов и объектов, а не функций и команд. Большинство современных языков программирования, включая C++, C#, Python и Ruby, являются объектно-ориентированными.

Эти признаки делают Java универсальным и относительно простым в изучении языком, который чрезвычайно популярен среди разработчиков программного обеспечения и технологических компаний. Если вы ищете карьеру в области кодирования или компьютерного программирования, знание того, как писать на Java, является ценным навыком.

Когда был создан Java?

Java был изобретен Джеймсом Гослингом в 1995 году, когда он работал в Sun Microsystems. Несмотря на то, что Java быстро завоевал популярность после своего выпуска, он не начинал как мощный язык программирования, которым он является сегодня.

Разработка того, что впоследствии стало Java, началась в Sun Microsystems в 1991 году. Проект, первоначально называвшийся Oak, изначально был разработан для интерактивного телевидения. Когда Oak сочли слишком продвинутым для цифровой кабельной технологии, доступной в то время, Гослинг и его команда переключили свое внимание на создание языка программирования и переименовали проект в Java в честь сорта кофе из Индонезии. Гослинг рассматривал Java как шанс решить проблемы, которые, как он ожидал, возникнут для менее переносимых языков по мере того, как все больше устройств будут объединены в сеть.

Язык Java был разработан с использованием синтаксиса, аналогичного языку C++, поэтому он уже был знаком программистам, когда они начинали его использовать. С лозунгом «написать один раз, запускать где угодно» в своей основе программист мог написать код Java для одной платформы, который будет работать на любой другой платформе, на которой установлен интерпретатор Java (т. е. виртуальная машина Java). С появлением Интернета и распространением новых цифровых устройств в середине 1990-х годов разработчики быстро восприняли Java как действительно многоплатформенный язык.

Первая общедоступная версия Java, Java 1.0, была выпущена в 1996 году. В течение пяти лет у нее было 2,5 миллиона разработчиков по всему миру. Сегодня на Java работает все, от мобильной операционной системы Android до корпоративного программного обеспечения.

Для чего используется язык Java?

Java — очень переносимый язык, используемый на разных платформах и устройствах разных типов, от смартфонов до умных телевизоров. Он используется для создания мобильных и веб-приложений, корпоративного программного обеспечения, устройств Интернета вещей (IoT), игр, больших данных, распределенных и облачных приложений среди других типов. Вот несколько реальных примеров приложений, написанных на языке Java.

Мобильные приложения

Многие, если не большинство, мобильных приложений созданы на Java. Java является предпочтительным языком разработчиков мобильных приложений из-за его стабильной платформы и универсальности. Популярные мобильные приложения, написанные на Java, включают Spotify, Signal и Cash App.

Веб-приложения

С помощью Java разрабатывается большое количество веб-приложений. Twitter и LinkedIn являются одними из самых известных.

Корпоративное программное обеспечение

Корпоративное программное обеспечение — это программное обеспечение, предназначенное для обслуживания большой группы или организации. Он включает в себя программное обеспечение, такое как системы выставления счетов и программы управления логистическими цепочками. Высокая масштабируемость Java делает его привлекательным языком для разработчиков, создающих корпоративное программное обеспечение.

Игры

Популярные игры, написанные на языке Java, включают оригинальный Minecraft и RuneScape.

Приложения Интернета вещей

Приложения Интернета вещей есть везде: умные телевизоры, автомобили, тяжелая техника, рабочие помещения и т. д. Java используется для программирования многих из них. Java — популярный выбор для разработчиков Интернета вещей из-за того, насколько легко его код может быть перенесен между платформами.

Что такое JavaScript и чем он отличается от Java?

В отличие от Java, у JavaScript есть единственная функция: создание сценариев для запуска веб-браузеров. Эти сценарии есть во всем интернете. Среди прочего, они используются для игр на основе браузера, анимации веб-страниц, регистрации журнала пользователей и всплывающей рекламы. По сути, все, что обновляется на веб-сайте без перезагрузки страницы, скорее всего, является JavaScript.

Java, как мы рассмотрели, используется не только для веб-сайтов, но и для других целей.

Как работает Java?

Как объяснялось ранее, Java — это многоплатформенный язык. Это означает, что его можно написать для одной ОС, а запустить на другой. Как это возможно?

Код Java сначала пишется в комплекте комплектом SDK Java, который доступен для Windows, Linux и macOS. Программисты пишут на языке Java, который комплект переводит в компьютерный код, который может быть прочитан любым устройством с соответствующим программным обеспечением. Это достигается с помощью программного обеспечения, называемого компилятором. Компилятор берет высокоуровневый компьютерный код, такой как Java, и переводит его на язык, который понимают операционные системы, называемый байт-кодом.

Затем байт-код обрабатывается интерпретатором, называемым виртуальной машиной Java (JVM). JVM доступны для большинства программных и аппаратных платформ, и именно это позволяет переносить код Java с одного устройства на другое. Для запуска JVM Java загружают код, проверяют его и предоставляют среду выполнения.

Учитывая высокую переносимость Java, неудивительно, что многие хотят научиться писать на нем. К счастью, есть много доступных ресурсов для начала изучения Java.

Подробнее о Java

Итак, что означает Java для начинающих программистов? С точки зрения стоящей инвестиции, чтобы учиться: много. Несмотря на то, что он существует уже более 20 лет, он остается одним из лучших языков, потому что:

  • Он исключительно универсален, используется во многих различных отраслях и операционных системах, и операционная система Android основана на нем.
  • Его легко выучить, и он считается отличным первым языком для изучения основ программирования.
  • Учебники по Java, учебные курсы и онлайн-сообщества можно легко найти, чтобы начать работу и получать постоянную поддержку по мере того, как вы будете набираться опыта.

Может быть полезно разделить изучение Java на два этапа: во-первых, научиться программировать на Java, а во-вторых, научиться использовать язык в различных средах разработки. Это важно, потому что даже специалистам по Java необходимо научиться использовать инструменты и среды Java, с которыми они знакомы, в разных местах.

Ознакомьтесь с этими учебными ресурсами как для начинающих, так и для экспертов.

Учебники по Java для начинающих

Образовательный: изучайте Java с нуля

Этот бесплатный 12-часовой интерактивный учебник по Java начинается с простого урока «Hello World!», продвигает основные концепции программирования и завершается оценочным экзаменом.

Учебники и ресурсы по Java для опытных пользователей

Блог Java

Получайте новости, обновления и идеи для разработки с помощью Java в этом блоге разработчиков Java для разработчиков Java.

Java на Azure

Найдите то, что вам нужно, чтобы приступить к разработке и модернизации корпоративных приложений Java в Azure, включая поддержку Java EE, Spring Boot и Kubernetes.

Начало работы с Java на Azure

Узнайте, как создавать, переносить и масштабировать приложения Java, используя уже знакомые вам инструменты и платформы Java, с помощью служб Azure.

Часто задаваемые вопросы

  • Java– популярный многоплатформенный объектно-ориентированный язык программирования. Java можно использовать в качестве платформы через виртуальные машины Java (JVM), которые можно установить на большинстве компьютеров и мобильных устройств.

    Дополнительные сведения

  • Java был создан Джеймсом Гослингом в 1995году, когда он работал в Sun Microsystems. Разработка Java началась в 1991 г., а первая общедоступная версия была выпущена в январе 1996 г.

    Дополнительные сведения

  • Язык Java используется на разных платформах и устройствах благодаря легко переносимому коду. Популярное использование Java включает корпоративное программное обеспечение, разработку мобильных приложений, веб-приложения, облачные приложения, игры и приложения Интернета вещей.

    Дополнительные сведения

  • Java– чрезвычайно универсальный язык программирования. Его можно использовать для программирования программного обеспечения и приложений для различных операционных систем и устройств, включая устройства Интернета вещей, мобильные телефоны и компьютеры.

    Дополнительные сведения

  • Код Java обрабатывается компилятором, который преобразует его в байт-код, который считывает операционная система. Байт-код из Java обрабатывается виртуальной машиной Java, которая проверяет код и предоставляет среду выполнения для приложений Java.

    Дополнительные сведения

  • Существует множество вариантов изучения Java помимо традиционного школьного образования. Coursera, Udemy и многие другие компании предлагают сертификаты Java, которые можно получить менее чем за 6 месяцев. В Интернете также доступны бесплатные учебные пособия, видеоролики и курсы.

    Дополнительные сведения

Начните разработку с помощью Java в Azure бесплатно

Бесплатно получайте популярные службы в течение 12 месяцев, а также более 40 других бесплатных служб постоянно — плюс кредит в размере $200 для использования в течение первых 30 дней.

Изучите все ресурсы Майкрософт по Java

Узнайте, как создавать и развертывать приложения и службы Java с использованием технологий Майкрософт.

Здесь есть все, что вам нужно знать о различных версиях и функциях Java.


Java 8, Java 11, Java 13 — какая разница?

Вы можете использовать это руководство, чтобы найти и установить последнюю версию Java, понять различия между дистрибутивами Java (AdoptOpenJdk, OpenJDK, OracleJDK и т.д.), А также получить обзор возможностей языка Java, включая версии Java 8-13.

Примечание переводчика
09 апреля 2020 г. Марко опубликовал новую версию Руководства, в которую добавлено описание Java 14.
Перевод новой версии Руководства предлагается Вашему вниманию.

Исходная информация

Во-первых, давайте взглянем на некоторые общие практические вопросы, которые возникают у людей при попытке выбрать правильную версию Java для своего проекта.

Если вы хотите узнать больше о конкретной версии, перейдите на сайт AdoptOpenJDK, выберите последнюю версию Java, загрузите и установите ее. Затем вернитесь к этому руководству и узнайте еще кое-что о разных версиях Java.

Какую версию Java я должен использовать?

По состоянию на сентябрь 2019 года Java 13 является последней выпущенной версией Java, с новыми версиями, выходящими каждые 6 месяцев — Java 14 запланирована на март 2020 года, Java 15 на сентябрь 2020 года и т.д. В прошлом циклы выпуска Java были намного длиннее, до 3-5 лет!

С появлением такого количества новых версий в действительности имеются следующие основные сценарии использования:

  • Унаследованные проекты в компаниях часто связаны с использованием Java 8 (см. Раздел «Почему компании все еще застревают на Java 8?» Ниже). Таким образом, вы также будете вынуждены использовать Java 8.
  • Некоторые унаследованные проекты даже работают на Java 1.5 (выпущен в 2004 г.) или 1.6 (выпущен в 2006 г.) — сожалею, друзья!
  • Если вы уверены, что используете самые последние IDE, интегрированные среды и инструменты сборки и запускаете новый проект, вы можете без колебаний использовать Java 11 (LTS) или даже самую последнюю версию Java 13.
  • Есть специальная область разработки Android, где Java в основном застряла на версии Java 7, с доступом к определенному набору функций Java 8. Но вы можете переключиться на использование языка программирования Kotlin.

Почему компании все еще застряли на Java 8?

Существует множество разных причин, по которым компании все еще придерживаются Java 8. Вот некоторые из них:

  • Инструменты сборки (Maven, Gradle и т.д.) и некоторые библиотеки изначально имели ошибки с версиями Java версий> 8 и нуждались в обновлениях. Даже сегодня, например, с Java 9+, некоторые инструменты сборки выводят предупреждения «reflective access» при создании проектов Java, которые просто «не готовы», даже если со сборкой все в порядке.
  • До Java 8 вы в основном использовали JDK-сборки Oracle, и вам не нужно было заботиться о лицензировании. Однако в 2019 году Oracle изменила схему лицензирования, что привело к тому, что Интернет сошел с ума, сказав, что «Java больше не является бесплатной», — и последовало значительное замешательство. Однако на самом деле это не проблема, о чем вы узнаете в разделе «Дистрибутивы Java» данного руководства.
  • В некоторых компаниях действуют политики, позволяющие использовать только версии LTS, и полагаются на поставщиков своих ОС для предоставления этих сборок, что требует времени.

Подводя итог, у вас есть сочетание практических вопросов (обновление ваших инструментов, библиотек, фреймворков) и политических проблем.

Почему некоторые версии Java называются 1.X?

Java до версии 9 просто имела другую схему именования. Итак, Java 8 также может называться 1.8, Java 5 может называться 1.5 и т.д. Когда вы выполнили команду java -version с этими версиями, вы получили такой вывод:

c:Program FilesJavajdk1.8.0_191bin>java -version
java version "1.8.0_191" (1)
Java(TM) SE Runtime Environment (build 1.8.0_191-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.191-b12, mixed mode)

Это просто означает Java 8. С переходом к основанным на времени выпускам с Java 9 также изменилась схема именования, и версии Java больше не имеют префикса 1.x. Теперь номер версии выглядит так:

c:Program FilesJavajdk11bin>java -version
openjdk version "11" 2018-09-25 (1)
OpenJDK Runtime Environment 18.9 (build 11+28)
OpenJDK 64-Bit Server VM 18.9 (build 11+28, mixed mode)

В чем разница между версиями Java?

Должен ли я изучать конкретную?

Придя из других языков программирования с большими перерывами между выпусками, как, например, Python 2–3, вы можете спросить, применимо ли это к Java.

Java особенная в этом отношении, поскольку она чрезвычайно обратно совместима. Это означает, что ваша программа на Java 5 или 8 гарантированно будет работать с виртуальной машиной Java 8-13 — с некоторыми исключениями, о которых вам сейчас не нужно беспокоиться.

Очевидно, что это не работает наоборот, скажем, ваша программа использует функции Java 13, которые просто недоступны в Java 8 JVM.

Это означает несколько вещей:

  • Вы не просто «изучаете» конкретную версию Java, например Java 12.
  • Скорее, вам нужно получить хорошую основу для всех языковых возможностей вплоть до Java 8.
  • И затем, из этого руководства вы можете узнать, какие дополнительные функции появились в Java 9-13, чтобы использовать их всегда, когда это возможно.

Каковы примеры этих новых возможностей новых версий Java?

Взгляните на раздел «Возможности Java 8-13» ниже.

Но, как правило: старые, более длинные циклы выпуска (3-5 лет, вплоть до Java 8) означали множество новых функций в каждом выпуске.

Шестимесячный цикл выпуска означает меньшее количество функций на выпуск, поэтому вы можете быстро освоить языковые функции Java 9-13.

В чем разница между JRE и JDK?

До сих пор мы говорили только о Java. Но что именно означает «Java»?

Во-первых, вам нужно провести различие между JRE (Java Runtime Environment) и JDK (Java Development Kit).

Исторически, вы загружали только JRE, если вас интересовали только программы Java. JRE включает, помимо прочего, виртуальную машину Java (JVM) и инструмент командной строки «java».

Для разработки новых программ на Java вам нужно было загрузить JDK. JDK включает в себя все, что есть в JRE, а также компилятор javac и несколько других инструментов, таких как javadoc (генератор документации Java) и jdb (отладчик Java).

Теперь, почему я говорю в прошедшем времени?

Вплоть до Java 8 веб-сайт Oracle предлагал JRE и JDK в качестве отдельных загрузок, хотя JDK также всегда включал JRE в отдельной папке. В Java 9 это различие практически исчезло, и вы всегда загружаете JDK. Структура каталогов JDK также изменилась, так как в ней больше не было явной папки JRE.

Таким образом, хотя некоторые дистрибутивы (см. Раздел «Дистрибутивы Java») по-прежнему предлагают отдельную загрузку JRE, похоже, существует тенденция предлагать только JDK. Следовательно, теперь мы будем использовать Java и JDK взаимозаменяемо.

Как мне установить Java или JDK?

На данный момент не обращайте внимания на образы Java-Docker, оболочки MSI или пакеты для конкретной платформы. В конце концов, Java — это просто файл .zip; ни больше ни меньше.

Поэтому все, что вам нужно сделать, чтобы установить Java на свой компьютер, — это разархивировать файл jdk-{5-13}.zip. Вам даже не нужны права администратора для этого.

Ваш распакованный файл Java будет выглядеть так:

Directory C:devjdk-11
12.11.2019  19:24    <DIR>          .
12.11.2019  19:24    <DIR>          ..
12.11.2019  19:23    <DIR>          bin
12.11.2019  19:23    <DIR>          conf
12.11.2019  19:24    <DIR>          include
12.11.2019  19:24    <DIR>          jmods
22.08.2018  19:18    <DIR>          legal
12.11.2019  19:24    <DIR>          lib
12.11.2019  19:23             1.238 release

Магия происходит в каталоге / bin, который в Windows выглядит следующим образом:

Directory C:devjdk-11bin
...
12.11.2019  19:23           272.736 java.exe
...
12.11.2019  19:23            20.832 javac.exe
...

Поэтому все, что вам нужно сделать, это разархивировать этот файл и поместить каталог /bin в переменную PATH, чтобы вы могли вызывать команду java из любого места.

В случае, если вам интересно, установщики с графическим интерфейсом, такие как Oracle или AdoptOpenJDK, выполняет распаковку и изменение переменной PATH вместо вас.

Чтобы убедиться, что вы правильно установили Java, вы можете просто выполнить команду java -version. Если вывод выглядит так, как показано ниже, вы готовы!

openjdk version "11" 2018-09-25
OpenJDK Runtime Environment 18.9 (build 11+28)
OpenJDK 64-Bit Server VM 18.9 (build 11+28, mixed mode)

Теперь остался один вопрос: откуда вам взять этот .zip файл с Java? Что подводит нас к теме дистрибутивов.

Дистрибутивы Java

Существует множество сайтов, предлагающих загрузку Java (читай: JDK), и неясно, «кто что предлагает и с каким лицензированием». Этот раздел проливает свет на это.

Проект OpenJDK

С точки зрения исходного кода Java (читай: исходный код вашего JRE / JDK) есть только один — на сайте проекта OpenJDK.

Однако это всего лишь исходный код, а не распространяемая сборка (подумайте: ваш файл .zip с скомпилированной командой java для вашей конкретной операционной системы). Теоретически вы и я могли бы создать сборку из этого исходного кода, назвать ее, скажем, MarcoJDK, и начать ее дистрибуцию. Но наш дистрибутив не будет сертифицирован, чтобы можно было называть этот дистрибутив совместимым с Java SE.

Вот почему на практике есть несколько поставщиков, которые фактически создают эти сборки, сертифицируют (см. TCK) и затем распространяют их.

И хотя поставщики не могут, скажем, удалить метод из класса String перед созданием новой сборки Java, они могут добавить брэндинг (вay!) или добавить некоторые другие утилиты (например, CLI), которые они считают полезными. Но в остальном исходный код одинаков для всех дистрибутивов Java.

OpenJDK (от Oracle) и сборки OracleJDK

Один из поставщиков, который создает Java из исходного кода, — это Oracle. Это приводит к двум разным дистрибутивам Java, что поначалу может быть очень запутанными.

  1. Сборки OpenJDK от Oracle (!). Эти сборки бесплатны и не имеют торговой марки, но Oracle не выпустит обновления для более старых версий, скажем, Java 13, как только выйдет Java 14.
  2. OracleJDK — это коммерческая сборка под брендом, выпускаемая начиная с изменения лицензии в 2019 году. Это означает, что ее можно использовать бесплатно во время разработки, но вы должны платить Oracle, если используете ее в рабочей среде. При этом вы получаете более длительную поддержку, то есть все обновления дистрибутива и номер телефона, по которому можно позвонить, если с вашей JVM будут проблемы.

Исторически (до Java 8) существовали реальные исходные различия между сборками OpenJDK и сборками OracleJDK, при этом можно было сказать, что OracleJDK был «лучше». Но на сегодняшний день обе версии практически одинаковы, с небольшими отличиями.

Впрочем все сводится к тому, что вам требуется платная коммерческая поддержка (номер телефона) для используемой версии Java.

AdoptOpenJDK

В 2017 году группа участников, разработчиков и поставщиков Java User Group (Amazon, Microsoft, Pivotal, Red Hat и другие) создала сообщество под названием AdoptOpenJDK.

Они предоставляют бесплатные надежные сборки OpenJDK с более длительной доступностью / обновлениями и даже предлагают вам выбор из двух разных виртуальных машин Java: HotSpot и OpenJ9.

Я очень рекомендую ее, если вы хотите установить Java.

Azul Zulu, Amazon Corretto, SAPMachine

Полный список сборок OpenJDK вы найдете на сайте OpenJDK Wikipedia. Среди них Azul Zulu, Amazon Corretto, а также https://sap.github.io/SapMachine/ и многие другие. Упрощенно говоря, различия сводятся к тому, что у вас есть различные варианты поддержки/ гарантии обслуживания.

Но не забудьте проверить на сайтах дистрибьюторов, чтобы узнать о преимуществах каждого отдельного дистрибутива.

Рекомендация

Повторим с еще раз, что с 2019 года, если у вас нет особых требований, найдите файл jdk.zip (.tar.gz/.msi/.pkg) по адресу https://adoptopenjdk.net или выберите пакет, предоставленный вашим поставщиком ОС.

Возможности Java 8-13

Как уже упоминалось в самом начале этого руководства: в сущности все (если вы не будьте слишком требовательны) функции языка Java 8 работают в Java 13. То же самое касается всех других версий Java между ними.

В свою очередь, это означает, что знание всех языковых функций Java 8 дает хорошую базу в изучении Java, а все остальные версии (Java 9-13) в значительной степени дают дополнительные функции поверх этого базового уровня.

Вот краткий обзор того, что конкретные версии могут предложить:

Java 8

Java 8 была массовым выпуском, и вы можете найти список всех функций на веб-сайте Oracle. Здесь я хотел бы упомянуть два основных набора функций:

Особенности языка: лямбды и т.д.

До Java 8 всякий раз, когда вы хотели создать экземпляр, например, нового Runnable, вы должны были написать анонимный внутренний класс, например, так:

 Runnable runnable = new Runnable(){
       @Override
       public void run(){
         System.out.println("Hello world !");
       }
     };

С лямбдами тот же код выглядит так:

Runnable runnable = () -> System.out.println("Hello world two!");

Вы также получили ссылки на методы, повторяющиеся аннотации, методы по умолчанию для интерфейсов и некоторые другие языковые функции.

Коллекции и потоки

В Java 8 вы также получили операции в функциональном стиле для коллекций, также известные как Stream API. Быстрый пример:

List<String> list = Arrays.asList("franz", "ferdinand", "fiel", "vom", "pferd");

До Java 8, вам нужно было написать циклы for, чтобы что-то сделать с этим списком.

С помощью API Streams вы можете сделать следующее:

list.stream()
    .filter(name -> name.startsWith("f"))
    .map(String::toUpperCase)
    .sorted()
    .forEach(System.out::println);

Java 9

Java 9 также была довольно большой версией, с несколькими дополнениями:

Коллекции

Коллекции получили несколько новых вспомогательных методов для простого создания списков, наборов и карт.

List<String> list = List.of("one", "two", "three");
Set<String> set = Set.of("one", "two", "three");
Map<String, String> map = Map.of("foo", "one", "bar", "two");

Streams

Потоки получили несколько дополнений, в виде методов takeWhile, dropWhile и iterate.

Stream<String> stream = Stream.iterate("", s -> s + "s")
  .takeWhile(s -> s.length() < 10);

Optionals

Optionals получили метод ifPresentOrElse, которого крайне не хватало.

user.ifPresentOrElse(this::displayAccount, this::displayLogin);

Интерфейсы

Интерфейсы получили private методы:

public interface MyInterface {
    private static void myPrivateMethod(){
        System.out.println("Yay, I am private!");
    }
}

Другие возможности языка

И пара других улучшений, таких как улучшенный оператор try-with-resources или расширения diamond оператора.

JShell

Наконец, в Java появилась оболочка, в которой вы можете попробовать простые команды и получить немедленные результаты.

% jshell
|  Welcome to JShell -- Version 9
|  For an introduction type: /help intro
jshell> int x = 10
x ==> 10

HTTPClient

Java 9 принес первоначальную предварительную версию нового HttpClient. До этого встроенная поддержка Http в Java была довольно низкоуровневой, и вам приходилось использовать сторонние библиотеки, такие как Apache HttpClient или OkHttp (кстати, отличные библиотеки).

В Java 9 у Java появился собственный современный клиент — хотя он находится в режиме превью, что означает, что он может быть изменен в более поздних версиях Java.

Проект Jigsaw: модули Java и файлы Jar с несколькими выпусками

Java 9 получила Jigsaw Module System, которая чем-то напоминает старую добрую спецификацию OSGI. Целью данного руководства не является подробное описание Jigsaw — посмотрите предыдущие ссылки, чтобы узнать больше.

Файлы Multi-Release .jar позволили создать один файл .jar, содержащий разные классы для разных версий JVM. Таким образом, ваша программа может вести себя по-разному / иметь разные классы, используемые при запуске на Java 8 и на Java 10, например.

Java 10

В Java 10 было несколько изменений, таких как сборка мусора и т.д. Но единственное реальное изменение, которое вы, как разработчик, вероятно, заметите, — это введение ключевого слова var, также называемого выводом типа локальной переменной.

Вывод типа локальной переменной: ключевое слово var

// Pre-Java 10
String myName = "Marco";
// With Java 10
var myName = "Marco"

Чувствуете себя как в Javascript-е, не так ли? Однако Java все еще строго типизирован и var применяется только к переменным внутри методов (спасибо, dpash, за то, что снова указал на это).

Java 11

Java 11 также была несколько меньшей версией с точки зрения разработчика.

Строки и файлы

Строки и файлы получили несколько новых методов (не все перечислены здесь):

"Marco".isBlank();
"Marnco".lines();
"Marco  ".strip();
Path path = Files.writeString(Files.createTempFile("helloworld", ".txt"), "Hi, my name is!");
String s = Files.readString(path);

Запустить исходные файлы

Начиная с Java 10, вы можете запускать исходные файлы Java без предварительной компиляции. Шаг к написанию сценариев.

ubuntu@DESKTOP-168M0IF:~$ java MyScript.java

Вывод типа локальной переменной (var) для лямбда-параметров

В заголовке все сказано:

(var firstName, var lastName) -> firstName + lastName

HttpClient

HttpClient из Java 9, но уже в окончательной, а не превью версии.

Другие вкусности

Flight Recorder (Регистратор полетов), сборщик мусора No-Op, Nashorn-Javascript-Engine объявлен deprecated (устаревшим) и т.д.

Java 12

В Java 12 появилось несколько новых функций и исправлений, но здесь стоит упомянуть только поддержку Unicode 11 и превью нового выражения switch, о котором вы узнаете в следующем разделе.

Java 13

Вы можете найти полный список возможностей здесь, но, по сути, вы получаете поддержку Unicode 12.1, а также две новые или улучшенные превью функции (могут быть изменены в будущем):

Switch выражение (Preview — предварительная версия)

Выражения переключателя теперь могут возвращать значение. И вы можете использовать лямбда-стиль синтаксиса для своих выражений, без проблем с ошибками:

Старые операторы switch выглядели так:

switch(status) {
  case SUBSCRIBER:
    // code block
    break;
  case FREE_TRIAL:
    // code block
    break;
  default:
    // code block
}

В то время как в Java 13 операторы switch могут выглядеть так:

boolean result = switch (status) {
    case SUBSCRIBER -> true;
    case FREE_TRIAL -> false;
    default -> throw new IllegalArgumentException("something is murky!");
};

Многострочные строки (превью)

Наконец-то вы можете сделать это на Java:

String htmlBeforeJava13 = "<html>n" +
              "    <body>n" +
              "        <p>Hello, world</p>n" +
              "    </body>n" +
              "</html>n";
String htmlWithJava13 = """
              <html>
                  <body>
                      <p>Hello, world</p>
                  </body>
              </html>
              """;

Java 14 и позже

Будет рассмотрено здесь, как только их выпустят. Зайдите в ближайшее время!

Вывод

К настоящему времени у вас должен быть довольно хорошее представление о нескольких вещах:

  • Как установить Java, какую версию получить и где ее получить (подсказка: AdoptOpenJDK).
  • Что такое дистрибутив Java, какие существуют и в чем различия.
  • Каковы различия между конкретными версиями Java.

Обратная связь, исправления и случайный ввод всегда приветствуются! Просто оставьте комментарий внизу.

Спасибо за прочтение!

Там больше, откуда это появилось

Эта статья первоначально появилась на сайте как часть серии руководств по современному программированию на Java. Чтобы найти больше руководств, посетите веб-сайт или подпишитесь на рассылку, чтобы получать уведомления о недавно опубликованных руководствах: https://bit.ly/2K0Ao4F.

Благодарности

Стивен Колебурн написал фантастическую статью о различных доступных дистрибутивах Java. Спасибо, Стивен!

Дополнительное чтение

JVM Ecosystem Survey: Why Devs Aren’t Switching to Java 11

Beyond Java 8

When Will Java 11 Replace Java 8 as the Default Java?

Java что это за программа и нужна ли она?

Откуда на компьютере появляется программа Java и для чего она нужна?

Говоря простым языком, Java это платформа для разработки и работы программ, игр и иных приложений, написанных с ее использованием. Более подробно о ней, а также о ее появлении на вашем компьютере мы поговорим в данной статье.

Описание программы

Первая версия программы Java была создана северно-американским разработчиком Sun Microsystems в конце предыдущего столетия. Изначально она именовалась как “Oak”, то есть “дуб” и предназначалась для программирования электронного оборудования в быту.

Программисты и продвинутые пользователи ПК использовали Java на устройствах, чтобы писать коды для так называемых «апплетов». Так в профессиональной среде именуют приложения, работа которых возможна через браузер. Например:

  • Календарь;
  • Виджет часов;
  • Гостевая книга
  • Интернет-сообщество, которое позволяет общаться в режиме реального времени.

Но Java необходима на компьютере не только для написания программ. Она нужна также и для их работы. Сейчас многие приложения, игры и интернет сайты используют ресурсы Java. Это значит, что для их работы требуется наличие актуальной версии данной программы.

Например, популярный Minecraft не начнет работать, если не установлена Java. Не запустится и такая система программирования как IDE. Она включает текстовый редактор, отладчик и другие функции, которые полезны для создания новых приложений на компьютер.

Почему на компьютере уже установлена программа Java?

Во многие операционные системы, в их число входит и Windows (начиная с версии Windows 98), уже  интегрирована программа Java, и появляется она сразу после установки. Также возможны ситуации, при которых во время установки той или иной игры Java будет установлена вместе с ней автоматически. Именно по этому удалять Java категорически запрещено. Это может привести к отказу в работе многих других приложений, установленных на вашем ПК.

Иногда пользователь будет получать уведомления о том, что появилась обновленная версия программы Java. Эти обновления нужно устанавливать обязательно ,чтобы не получить проблем с запуском других приложений в будущем.

что такое java На компьютере

Сообщение в системном трее про наличие обновления Java

Лучшая благодарность автору — репост к себе на страничку:

Понравилась статья? Поделить с друзьями:
  • Платформа фильтрации windows заблокировала пакет 5152
  • Планшеты для художников со стилусом на windows
  • Платформа фильтрации ip пакетов windows разрешила привязку к локальному порту
  • Планшеты асус с клавиатурой на windows 10
  • Планшеты apple со стилусом для рисования на windows