Java (programming language)

From Wikipedia for FEVERv2
Jump to navigation Jump to search

This article is about the programming language. Java (programming language)_sentence_0

For the software platform, see Java (software platform). Java (programming language)_sentence_1

For the software package downloaded from java.com, see Java Platform, Standard Edition. Java (programming language)_sentence_2

For other uses, see Java (disambiguation). Java (programming language)_sentence_3

"Java language" redirects here. Java (programming language)_sentence_4

It is not to be confused with Javanese language. Java (programming language)_sentence_5

Not to be confused with JavaScript. Java (programming language)_sentence_6

Java (programming language)_table_infobox_0

Java Programming LanguageJava (programming language)_table_caption_0
ParadigmJava (programming language)_header_cell_0_0_0 Multi-paradigm: generic, object-oriented (class-based), imperative, reflectiveJava (programming language)_cell_0_0_1
Designed byJava (programming language)_header_cell_0_1_0 James GoslingJava (programming language)_cell_0_1_1
DeveloperJava (programming language)_header_cell_0_2_0 Oracle Corporation et al.Java (programming language)_cell_0_2_1
First appearedJava (programming language)_header_cell_0_3_0 May 23, 1995; 25 years ago (1995-05-23)Java (programming language)_cell_0_3_1
Stable releaseJava (programming language)_header_cell_0_4_0 Java SE 15
  / September 15, 2020; 2 months ago (2020-09-15)Java (programming language)_cell_0_4_1
Typing disciplineJava (programming language)_header_cell_0_5_0 Static, strong, safe, nominative, manifestJava (programming language)_cell_0_5_1
Java (programming language)_header_cell_0_6_0 .java, ,Java (programming language)_cell_0_6_1
WebsiteJava (programming language)_header_cell_0_7_0 Java (programming language)_cell_0_7_1
Influenced byJava (programming language)_header_cell_0_8_0
InfluencedJava (programming language)_header_cell_0_9_0

Java is a class-based, object-oriented programming language that is designed to have as few implementation dependencies as possible. Java (programming language)_sentence_7

It is a general-purpose programming language intended to let application developers write once, run anywhere (WORA), meaning that compiled Java code can run on all platforms that support Java without the need for recompilation. Java (programming language)_sentence_8

Java applications are typically compiled to bytecode that can run on any Java virtual machine (JVM) regardless of the underlying computer architecture. Java (programming language)_sentence_9

The syntax of Java is similar to C and C++, but has fewer low-level facilities than either of them. Java (programming language)_sentence_10

The Java runtime provides dynamic capabilities (such as reflection and runtime code modification) that are typically not available in traditional compiled languages. Java (programming language)_sentence_11

As of 2019, Java was one of the most popular programming languages in use according to GitHub, particularly for client-server web applications, with a reported 9 million developers. Java (programming language)_sentence_12

Java was originally developed by James Gosling at Sun Microsystems (which has since been acquired by Oracle) and released in 1995 as a core component of Sun Microsystems' Java platform. Java (programming language)_sentence_13

The original and reference implementation Java compilers, virtual machines, and class libraries were originally released by Sun under proprietary licenses. Java (programming language)_sentence_14

As of May 2007, in compliance with the specifications of the Java Community Process, Sun had relicensed most of its Java technologies under the GNU General Public License. Java (programming language)_sentence_15

Oracle offers its own HotSpot Java Virtual Machine, however the official reference implementation is the OpenJDK JVM which is free open source software and used by most developers including the Eclipse IDE and is the default JVM for almost all Linux distributions. Java (programming language)_sentence_16

The latest version is Java 15, released in September 2020, with Java 11, a currently supported long-term support (LTS) version, released on September 25, 2018; Oracle released for the legacy Java 8 LTS the last zero-cost public update in January 2019 for commercial use, although it will otherwise still support Java 8 with public updates for personal use indefinitely. Java (programming language)_sentence_17

Other vendors have begun to offer zero-cost builds of OpenJDK 8 and 11 that are still receiving security and other upgrades. Java (programming language)_sentence_18

Oracle (and others) highly recommend uninstalling older versions of Java because of serious risks due to unresolved security issues. Java (programming language)_sentence_19

Since Java 9, 10, 12 and 13 are no longer supported, Oracle advises its users to immediately transition to the latest version (currently Java 15) or an LTS release. Java (programming language)_sentence_20

History Java (programming language)_section_0

See also: Java (software platform) § History Java (programming language)_sentence_21

James Gosling, Mike Sheridan, and Patrick Naughton initiated the Java language project in June 1991. Java (programming language)_sentence_22

Java was originally designed for interactive television, but it was too advanced for the digital cable television industry at the time. Java (programming language)_sentence_23

The language was initially called Oak after an oak tree that stood outside Gosling's office. Java (programming language)_sentence_24

Later the project went by the name Green and was finally renamed Java, from Java coffee, the coffee from Indonesia. Java (programming language)_sentence_25

Gosling designed Java with a C/C++-style syntax that system and application programmers would find familiar. Java (programming language)_sentence_26

Sun Microsystems released the first public implementation as Java 1.0 in 1996. Java (programming language)_sentence_27

It promised Write Once, Run Anywhere (WORA) functionality, providing no-cost run-times on popular platforms. Java (programming language)_sentence_28

Fairly secure and featuring configurable security, it allowed network- and file-access restrictions. Java (programming language)_sentence_29

Major web browsers soon incorporated the ability to run Java applets within web pages, and Java quickly became popular. Java (programming language)_sentence_30

The Java 1.0 compiler was re-written in Java by Arthur van Hoff to comply strictly with the Java 1.0 language specification. Java (programming language)_sentence_31

With the advent of Java 2 (released initially as J2SE 1.2 in December 1998 – 1999), new versions had multiple configurations built for different types of platforms. Java (programming language)_sentence_32

J2EE included technologies and APIs for enterprise applications typically run in server environments, while J2ME featured APIs optimized for mobile applications. Java (programming language)_sentence_33

The desktop version was renamed J2SE. Java (programming language)_sentence_34

In 2006, for marketing purposes, Sun renamed new J2 versions as Java EE, Java ME, and Java SE, respectively. Java (programming language)_sentence_35

In 1997, Sun Microsystems approached the ISO/IEC JTC 1 standards body and later the Ecma International to formalize Java, but it soon withdrew from the process. Java (programming language)_sentence_36

Java remains a de facto standard, controlled through the Java Community Process. Java (programming language)_sentence_37

At one time, Sun made most of its Java implementations available without charge, despite their proprietary software status. Java (programming language)_sentence_38

Sun generated revenue from Java through the selling of licenses for specialized products such as the Java Enterprise System. Java (programming language)_sentence_39

On November 13, 2006, Sun released much of its Java virtual machine (JVM) as free and open-source software (FOSS), under the terms of the GNU General Public License (GPL). Java (programming language)_sentence_40

On May 8, 2007, Sun finished the process, making all of its JVM's core code available under free software/open-source distribution terms, aside from a small portion of code to which Sun did not hold the copyright. Java (programming language)_sentence_41

Sun's vice-president Rich Green said that Sun's ideal role with regard to Java was as an evangelist. Java (programming language)_sentence_42

Following Oracle Corporation's acquisition of Sun Microsystems in 2009–10, Oracle has described itself as the steward of Java technology with a relentless commitment to fostering a community of participation and transparency. Java (programming language)_sentence_43

This did not prevent Oracle from filing a lawsuit against Google shortly after that for using Java inside the Android SDK (see the Android section). Java (programming language)_sentence_44

On April 2, 2010, James Gosling resigned from Oracle. Java (programming language)_sentence_45

In January 2016, Oracle announced that Java run-time environments based on JDK 9 will discontinue the browser plugin. Java (programming language)_sentence_46

Java software runs on everything from laptops to data centers, game consoles to scientific supercomputers. Java (programming language)_sentence_47

Principles Java (programming language)_section_1

There were five primary goals in the creation of the Java language: Java (programming language)_sentence_48

Versions Java (programming language)_section_2

As of September 2020, Java 8 and 11 are supported as Long Term Support (LTS) versions, and one later non-LTS version is supported. Java (programming language)_sentence_49

Major release versions of Java, along with their release dates: Java (programming language)_sentence_50

Java (programming language)_table_general_1

VersionJava (programming language)_header_cell_1_0_0 DateJava (programming language)_header_cell_1_0_1
JDK BetaJava (programming language)_cell_1_1_0 1995Java (programming language)_cell_1_1_1
JDK1.0Java (programming language)_cell_1_2_0 January 23, 1996Java (programming language)_cell_1_2_1
JDK 1.1Java (programming language)_cell_1_3_0 February 19, 1997Java (programming language)_cell_1_3_1
J2SE 1.2Java (programming language)_cell_1_4_0 December 8, 1998Java (programming language)_cell_1_4_1
J2SE 1.3Java (programming language)_cell_1_5_0 May 8, 2000Java (programming language)_cell_1_5_1
J2SE 1.4Java (programming language)_cell_1_6_0 February 6, 2002Java (programming language)_cell_1_6_1
J2SE 5.0Java (programming language)_cell_1_7_0 September 30, 2004Java (programming language)_cell_1_7_1
Java SE 6Java (programming language)_cell_1_8_0 December 11, 2006Java (programming language)_cell_1_8_1
Java SE 7Java (programming language)_cell_1_9_0 July 28, 2011Java (programming language)_cell_1_9_1
Java SE 8Java (programming language)_cell_1_10_0 March 18, 2014Java (programming language)_cell_1_10_1
Java SE 9Java (programming language)_cell_1_11_0 September 21, 2017Java (programming language)_cell_1_11_1
Java SE 10Java (programming language)_cell_1_12_0 March 20, 2018Java (programming language)_cell_1_12_1
Java SE 11Java (programming language)_cell_1_13_0 September 25, 2018Java (programming language)_cell_1_13_1
Java SE 12Java (programming language)_cell_1_14_0 March 19, 2019Java (programming language)_cell_1_14_1
Java SE 13Java (programming language)_cell_1_15_0 September 17, 2019Java (programming language)_cell_1_15_1
Java SE 14Java (programming language)_cell_1_16_0 March 17, 2020Java (programming language)_cell_1_16_1
Java SE 15Java (programming language)_cell_1_17_0 September 15, 2020Java (programming language)_cell_1_17_1

Editions Java (programming language)_section_3

See also: Free Java implementations § Class library Java (programming language)_sentence_51

Sun has defined and supports four editions of Java targeting different application environments and segmented many of its APIs so that they belong to one of the platforms. Java (programming language)_sentence_52

The platforms are: Java (programming language)_sentence_53

Java (programming language)_unordered_list_0

The classes in the Java APIs are organized into separate groups called packages. Java (programming language)_sentence_54

Each package contains a set of related interfaces, classes, subpackages and exceptions. Java (programming language)_sentence_55

Sun also provided an edition called Personal Java that has been superseded by later, standards-based Java ME configuration-profile pairings. Java (programming language)_sentence_56

Execution system Java (programming language)_section_4

Java JVM and bytecode Java (programming language)_section_5

Main articles: Java (software platform) and Java virtual machine Java (programming language)_sentence_57

One design goal of Java is portability, which means that programs written for the Java platform must run similarly on any combination of hardware and operating system with adequate run time support. Java (programming language)_sentence_58

This is achieved by compiling the Java language code to an intermediate representation called Java bytecode, instead of directly to architecture-specific machine code. Java (programming language)_sentence_59

Java bytecode instructions are analogous to machine code, but they are intended to be executed by a virtual machine (VM) written specifically for the host hardware. Java (programming language)_sentence_60

End users commonly use a Java Runtime Environment (JRE) installed on their machine for standalone Java applications, or in a web browser for Java applets. Java (programming language)_sentence_61

Standard libraries provide a generic way to access host-specific features such as graphics, threading, and networking. Java (programming language)_sentence_62

The use of universal bytecode makes porting simple. Java (programming language)_sentence_63

However, the overhead of interpreting bytecode into machine instructions made interpreted programs almost always run more slowly than native executables. Java (programming language)_sentence_64

Just-in-time (JIT) compilers that compile byte-codes to machine code during runtime were introduced from an early stage. Java (programming language)_sentence_65

Java itself is platform-independent and is adapted to the particular platform it is to run on by a Java virtual machine (JVM) for it, which translates the Java bytecode into the platform's machine language. Java (programming language)_sentence_66

Performance Java (programming language)_section_6

Main article: Java performance Java (programming language)_sentence_67

Programs written in Java have a reputation for being slower and requiring more memory than those written in C++ . Java (programming language)_sentence_68

However, Java programs' execution speed improved significantly with the introduction of just-in-time compilation in 1997/1998 for Java 1.1, the addition of language features supporting better code analysis (such as inner classes, the StringBuilder class, optional assertions, etc.), and optimizations in the Java virtual machine, such as HotSpot becoming the default for Sun's JVM in 2000. Java (programming language)_sentence_69

With Java 1.5, the performance was improved with the addition of the java.util.concurrent package, including lock free implementations of the ConcurrentMaps and other multi-core collections, and it was improved further with Java 1.6. Java (programming language)_sentence_70

Non-JVM Java (programming language)_section_7

Some platforms offer direct hardware support for Java; there are micro controllers that can run Java bytecode in hardware instead of a software Java virtual machine, and some ARM-based processors could have hardware support for executing Java bytecode through their Jazelle option, though support has mostly been dropped in current implementations of ARM. Java (programming language)_sentence_71

Automatic memory management Java (programming language)_section_8

Java uses an automatic garbage collector ( AGC ) to manage memory in the object lifecycle. Java (programming language)_sentence_72

The programmer determines when objects are created, and the Java runtime is responsible for recovering the memory once objects are no longer in use. Java (programming language)_sentence_73

Once no references to an object remain, the unreachable memory becomes eligible to be freed automatically by the garbage collector. Java (programming language)_sentence_74

Something similar to a memory leak may still occur if a programmer's code holds a reference to an object that is no longer needed, typically when objects that are no longer needed are stored in containers that are still in use. Java (programming language)_sentence_75

If methods for a non-existent object are called, a null pointer exception is thrown. Java (programming language)_sentence_76

One of the ideas behind Java's automatic memory management model is that programmers can be spared the burden of having to perform manual memory management. Java (programming language)_sentence_77

In some languages, memory for the creation of objects is implicitly allocated on the stack or explicitly allocated and deallocated from the heap. Java (programming language)_sentence_78

In the latter case, the responsibility of managing memory resides with the programmer. Java (programming language)_sentence_79

If the program does not deallocate an object, a memory leak occurs. Java (programming language)_sentence_80

If the program attempts to access or deallocate memory that has already been deallocated, the result is undefined and difficult to predict, and the program is likely to become unstable or crash. Java (programming language)_sentence_81

This can be partially remedied by the use of smart pointers, but these add overhead and complexity. Java (programming language)_sentence_82

Note that garbage collection does not prevent logical memory leaks, i.e. those where the memory is still referenced but never used. Java (programming language)_sentence_83

Garbage collection may happen at any time. Java (programming language)_sentence_84

Ideally, it will occur when a program is idle. Java (programming language)_sentence_85

It is guaranteed to be triggered if there is insufficient free memory on the heap to allocate a new object; this can cause a program to stall momentarily. Java (programming language)_sentence_86

Explicit memory management is not possible in Java. Java (programming language)_sentence_87

Java does not support C/C++ style pointer arithmetic, where object addresses can be arithmetically manipulated (e.g. by adding or subtracting an offset). Java (programming language)_sentence_88

This allows the garbage collector to relocate referenced objects and ensures type safety and security. Java (programming language)_sentence_89

As in C++ and some other object-oriented languages, variables of Java's primitive data types are either stored directly in fields (for objects) or on the stack (for methods) rather than on the heap, as is commonly true for non-primitive data types (but see escape analysis). Java (programming language)_sentence_90

This was a conscious decision by Java's designers for performance reasons. Java (programming language)_sentence_91

Java contains multiple types of garbage collectors. Java (programming language)_sentence_92

By default, HotSpot uses the parallel scavenge garbage collector. Java (programming language)_sentence_93

However, there are also several other garbage collectors that can be used to manage the heap. Java (programming language)_sentence_94

For 90% of applications in Java, the Concurrent Mark-Sweep (CMS) garbage collector is sufficient. Java (programming language)_sentence_95

Oracle aims to replace CMS with the Garbage-First Collector (G1). Java (programming language)_sentence_96

Having solved the memory management problem does not relieve the programmer of the burden of handling properly other kinds of resources, like network or database connections, file handles, etc., especially in the presence of exceptions. Java (programming language)_sentence_97

Paradoxically, the presence of a garbage collector has faded the necessity of having an explicit destructor method in the classes, thus rendering the management of these other resources more difficult. Java (programming language)_sentence_98

Syntax Java (programming language)_section_9

Main article: Java syntax Java (programming language)_sentence_99

The syntax of Java is largely influenced by C++ and C. Java (programming language)_sentence_100

Unlike C++, which combines the syntax for structured, generic, and object-oriented programming, Java was built almost exclusively as an object-oriented language. Java (programming language)_sentence_101

All code is written inside classes, and every data item is an object, with the exception of the primitive data types, (i.e. integers, floating-point numbers, boolean values, and characters), which are not objects for performance reasons. Java (programming language)_sentence_102

Java reuses some popular aspects of C++ (such as the printf method). Java (programming language)_sentence_103

Unlike C++, Java does not support operator overloading or multiple inheritance for classes, though multiple inheritance is supported for interfaces. Java (programming language)_sentence_104

Java uses comments similar to those of C++. Java (programming language)_sentence_105

There are three different styles of comments: a single line style marked with two slashes (//), a multiple line style opened with /* and closed with */, and the Javadoc commenting style opened with /** and closed with */. Java (programming language)_sentence_106

The Javadoc style of commenting allows the user to run the Javadoc executable to create documentation for the program and can be read by some integrated development environments (IDEs) such as Eclipse to allow developers to access documentation within the IDE. Java (programming language)_sentence_107

Hello world example Java (programming language)_section_10

The traditional Hello world program can be written in Java as: Java (programming language)_sentence_108

All source files must be named after the public class they contain, appending the suffix .java, for example, HelloWorldApp.java. Java (programming language)_sentence_109

It must first be compiled into bytecode, using a Java compiler, producing a file with the .class suffix (HelloWorldApp.class, in this case). Java (programming language)_sentence_110

Only then can it be executed or launched. Java (programming language)_sentence_111

The Java source file may only contain one public class, but it can contain multiple classes with a non-public access modifier and any number of public inner classes. Java (programming language)_sentence_112

When the source file contains multiple classes, it is necessary to make one class (introduced by the class keyword) public (preceded by the public keyword) and name the source file with that public class name. Java (programming language)_sentence_113

A class that is not declared public may be stored in any .java file. Java (programming language)_sentence_114

The compiler will generate a class file for each class defined in the source file. Java (programming language)_sentence_115

The name of the class file is the name of the class, with .class appended. Java (programming language)_sentence_116

For class file generation, anonymous classes are treated as if their name were the concatenation of the name of their enclosing class, a $, and an integer. Java (programming language)_sentence_117

The keyword public denotes that a method can be called from code in other classes, or that a class may be used by classes outside the class hierarchy. Java (programming language)_sentence_118

The class hierarchy is related to the name of the directory in which the .java file is located. Java (programming language)_sentence_119

This is called an access level modifier. Java (programming language)_sentence_120

Other access level modifiers include the keywords private (a method that can only be accessed in the same class) and protected (which allows code from the same package to access). Java (programming language)_sentence_121

If a piece of code attempts to access private methods or protected methods, the JVM will throw a SecurityException Java (programming language)_sentence_122

The keyword static in front of a method indicates a static method, which is associated only with the class and not with any specific instance of that class. Java (programming language)_sentence_123

Only static methods can be invoked without a reference to an object. Java (programming language)_sentence_124

Static methods cannot access any class members that are not also static. Java (programming language)_sentence_125

Methods that are not designated static are instance methods and require a specific instance of a class to operate. Java (programming language)_sentence_126

The keyword void indicates that the main method does not return any value to the caller. Java (programming language)_sentence_127

If a Java program is to exit with an error code, it must call System.exit() explicitly. Java (programming language)_sentence_128

The method name main is not a keyword in the Java language. Java (programming language)_sentence_129

It is simply the name of the method the Java launcher calls to pass control to the program. Java (programming language)_sentence_130

Java classes that run in managed environments such as applets and Enterprise JavaBeans do not use or need a main() method. Java (programming language)_sentence_131

A Java program may contain multiple classes that have main methods, which means that the VM needs to be explicitly told which class to launch from. Java (programming language)_sentence_132

The main method must accept an array of objects. Java (programming language)_sentence_133

By convention, it is referenced as args although any other legal identifier name can be used. Java (programming language)_sentence_134

Since Java 5, the main method can also use variable arguments, in the form of public static void main(String... args), allowing the main method to be invoked with an arbitrary number of String arguments. Java (programming language)_sentence_135

The effect of this alternate declaration is semantically identical (to the args parameter which is still an array of String objects), but it allows an alternative syntax for creating and passing the array. Java (programming language)_sentence_136

The Java launcher launches Java by loading a given class (specified on the command line or as an attribute in a ) and starting its public static void main(String[]) method. Java (programming language)_sentence_137

Stand-alone programs must declare this method explicitly. Java (programming language)_sentence_138

The String[] args parameter is an array of objects containing any arguments passed to the class. Java (programming language)_sentence_139

The parameters to main are often passed by means of a command line. Java (programming language)_sentence_140

Printing is part of a Java standard library: The class defines a public static field called . Java (programming language)_sentence_141

The out object is an instance of the class and provides many methods for printing data to standard out, including which also appends a new line to the passed string. Java (programming language)_sentence_142

The string "Hello World!" Java (programming language)_sentence_143

is automatically converted to a String object by the compiler. Java (programming language)_sentence_144

Example with methods Java (programming language)_section_11

Special classes Java (programming language)_section_12

Criticism Java (programming language)_section_13

Main article: Criticism of Java Java (programming language)_sentence_145

Criticisms directed at Java include the implementation of generics, speed, the handling of unsigned numbers, the implementation of floating-point arithmetic, and a history of security vulnerabilities in the primary Java VM implementation HotSpot. Java (programming language)_sentence_146

Class libraries Java (programming language)_section_14

Main article: Java Class Library Java (programming language)_sentence_147

The Java Class Library is the standard library, developed to support application development in Java. Java (programming language)_sentence_148

It is controlled by Oracle in cooperation with others through the Java Community Process program. Java (programming language)_sentence_149

Companies or individuals participating in this process can influence the design and development of the APIs. Java (programming language)_sentence_150

This process has been a subject of controversy during the 2010s. Java (programming language)_sentence_151

The class library contains features such as: Java (programming language)_sentence_152

Java (programming language)_unordered_list_1

  • The core libraries, which include:Java (programming language)_item_1_4
  • The integration libraries, which allow the application writer to communicate with external systems. These libraries include:Java (programming language)_item_1_16
    • The Java Database Connectivity (JDBC) API for database accessJava (programming language)_item_1_17
    • Java Naming and Directory Interface (JNDI) for lookup and discoveryJava (programming language)_item_1_18
    • RMI and CORBA for distributed application developmentJava (programming language)_item_1_19
    • JMX for managing and monitoring applicationsJava (programming language)_item_1_20
  • User interface libraries, which include:Java (programming language)_item_1_21
    • The (heavyweight, or native) Abstract Window Toolkit (AWT), which provides GUI components, the means for laying out those components and the means for handling events from those componentsJava (programming language)_item_1_22
    • The (lightweight) Swing libraries, which are built on AWT but provide (non-native) implementations of the AWT widgetryJava (programming language)_item_1_23
    • APIs for audio capture, processing, and playbackJava (programming language)_item_1_24
    • JavaFXJava (programming language)_item_1_25
  • A platform dependent implementation of the Java virtual machine that is the means by which the bytecodes of the Java libraries and third party applications are executedJava (programming language)_item_1_26
  • Plugins, which enable applets to be run in web browsersJava (programming language)_item_1_27
  • Java Web Start, which allows Java applications to be efficiently distributed to end users across the InternetJava (programming language)_item_1_28
  • Licensing and documentationJava (programming language)_item_1_29

Documentation Java (programming language)_section_15

Main article: Javadoc Java (programming language)_sentence_153

Javadoc is a comprehensive documentation system, created by Sun Microsystems. Java (programming language)_sentence_154

It provides developers with an organized system for documenting their code. Java (programming language)_sentence_155

Javadoc comments have an extra asterisk at the beginning, i.e. the delimiters are /** and */, whereas the normal multi-line comments in Java are set off with the delimiters /* and */, and single-line comments start off the line with //. Java (programming language)_sentence_156

Implementations Java (programming language)_section_16

See also: Free Java implementations Java (programming language)_sentence_157

Oracle Corporation is the current owner of the official implementation of the Java SE platform, following their acquisition of Sun Microsystems on January 27, 2010. Java (programming language)_sentence_158

This implementation is based on the original implementation of Java by Sun. Java (programming language)_sentence_159

The Oracle implementation is available for Microsoft Windows (still works for XP, while only later versions are currently officially supported), macOS, Linux, and Solaris. Java (programming language)_sentence_160

Because Java lacks any formal standardization recognized by Ecma International, ISO/IEC, ANSI, or other third-party standards organizations, the Oracle implementation is the de facto standard. Java (programming language)_sentence_161

The Oracle implementation is packaged into two different distributions: The Java Runtime Environment (JRE) which contains the parts of the Java SE platform required to run Java programs and is intended for end users, and the Java Development Kit (JDK), which is intended for software developers and includes development tools such as the Java compiler, Javadoc, , and a debugger. Java (programming language)_sentence_162

Oracle has also released GraalVM, a high performance Java dynamic compiler and interpreter. Java (programming language)_sentence_163

OpenJDK is another notable Java SE implementation that is licensed under the GNU GPL. Java (programming language)_sentence_164

The implementation started when Sun began releasing the Java source code under the GPL. Java (programming language)_sentence_165

As of Java SE 7, OpenJDK is the official Java reference implementation. Java (programming language)_sentence_166

The goal of Java is to make all implementations of Java compatible. Java (programming language)_sentence_167

Historically, Sun's trademark license for usage of the Java brand insists that all implementations be compatible. Java (programming language)_sentence_168

This resulted in a legal dispute with Microsoft after Sun claimed that the Microsoft implementation did not support RMI or JNI and had added platform-specific features of their own. Java (programming language)_sentence_169

Sun sued in 1997, and, in 2001, won a settlement of US$20 million, as well as a court order enforcing the terms of the license from Sun. Java (programming language)_sentence_170

As a result, Microsoft no longer ships Java with Windows. Java (programming language)_sentence_171

Platform-independent Java is essential to Java EE, and an even more rigorous validation is required to certify an implementation. Java (programming language)_sentence_172

This environment enables portable server-side applications. Java (programming language)_sentence_173

Use outside the Java platform Java (programming language)_section_17

The Java programming language requires the presence of a software platform in order for compiled programs to be executed. Java (programming language)_sentence_174

Oracle supplies the Java platform for use with Java. Java (programming language)_sentence_175

The Android SDK is an alternative software platform, used primarily for developing Android applications with its own GUI system. Java (programming language)_sentence_176

Android Java (programming language)_section_18

The Java language is a key pillar in Android, an open source mobile operating system. Java (programming language)_sentence_177

Although Android, built on the Linux kernel, is written largely in C, the Android SDK uses the Java language as the basis for Android applications but does not use any of its standard GUI, SE, ME or other established Java standards. Java (programming language)_sentence_178

The bytecode language supported by the Android SDK is incompatible with Java bytecode and runs on its own virtual machine, optimized for low-memory devices such as smartphones and tablet computers. Java (programming language)_sentence_179

Depending on the Android version, the bytecode is either interpreted by the Dalvik virtual machine or compiled into native code by the Android Runtime. Java (programming language)_sentence_180

Android does not provide the full Java SE standard library, although the Android SDK does include an independent implementation of a large subset of it. Java (programming language)_sentence_181

It supports Java 6 and some Java 7 features, offering an implementation compatible with the standard library (Apache Harmony). Java (programming language)_sentence_182

Controversy Java (programming language)_section_19

See also: Oracle America, Inc. v. Google, Inc. Java (programming language)_sentence_183

The use of Java-related technology in Android led to a legal dispute between Oracle and Google. Java (programming language)_sentence_184

On May 7, 2012, a San Francisco jury found that if APIs could be copyrighted, then Google had infringed Oracle's copyrights by the use of Java in Android devices. Java (programming language)_sentence_185

District Judge William Haskell Alsup ruled on May 31, 2012, that APIs cannot be copyrighted, but this was reversed by the United States Court of Appeals for the Federal Circuit in May 2014. Java (programming language)_sentence_186

On May 26, 2016, the district court decided in favor of Google, ruling the copyright infringement of the Java API in Android constitutes fair use. Java (programming language)_sentence_187

In March 2018, this ruling was overturned by the Appeals Court, which sent down the case of determining the damages to federal court in San Francisco. Java (programming language)_sentence_188

Google filed a petition for writ of certiorari with the Supreme Court of the United States in January 2019 to challenge the two rulings that were made by the Appeals Court in Oracle's favor. Java (programming language)_sentence_189

See also Java (programming language)_section_20

Java (programming language)_unordered_list_2

Comparison of Java with other languages Java (programming language)_section_21

Java (programming language)_unordered_list_3


Credits to the contents of this page go to the authors of the corresponding Wikipedia page: en.wikipedia.org/wiki/Java (programming language).