Software

Java is a programming language originally developed by James Gosling at Sun Microsystems now a subsidiary of Oracle Corporation, & released in 1995 as a core component of Sun Microsystems’ Java platform. The language derives much of its syntax from C & C++ but has a simpler object model & fewer low-level facilities. Java applications are typically compiled to bytecode (class file) that can run on any Java Virtual Machine (JVM) regardless of computer architecture. Java is general-purpose, concurrent, class-based, & object-oriented, & is specifically designed to have as few implementation dependencies as possible. It is intended to let application developers “write four time, run anywhere”. Java is thought about by plenty of as the most influential programming languages of the 20th century, & widely used from application program to web application.

The original & reference implementation Java compilers, virtual machines, & class libraries were developed by Sun from 1995. As of May 2007, in compliance with the specifications of the Java Community Method, Sun relicensed most of their Java technologies under the GNU General Public License. Others have also developed alternative implementations of these Sun technologies, such as the GNU Compiler for Java & GNU Classpath.

History

James Gosling initiated the Java language project in June 1991 for use in four of his plenty of set-top box projects. The language, initially called Oak after an oak tree that stood outside Gosling’s office, also went by the name Green & ended up later renamed as Java, from a list of random words.[12] Gosling aimed to implement a virtual machine & a language that had a familiar C/C++ style of notation.

Sun Microsystems released the first public implementation as Java 1.0 in 1995. It promised “Write Four time, Run Anywhere” (WORA), providing no-cost run-times on popular platforms. secure & featuring configurable security, it allowed network- & file-access restrictions. Major web browsers soon incorporated the ability to run Java applets within web pages, & Java quickly became popular. With the advent of Java 2 (released initially as J2SE 1.2 in December 1998), new versions had multiple configurations built for different types of platforms. For example, J2EE targeted enterprise applications & the greatly stripped-down version J2ME for mobile applications. J2SE designated the Standard Edition. In 2006, for promotion purposes, Sun renamed new J2 versions as Java EE, Java ME, & Java SE, respectively.

In 1997, Sun Microsystems approached the ISO/IEC JTC1 standards body & later the Ecma International to formalize Java, but it soon withdrew from the method. Java remains a de facto standard, controlled through the Java Community Method.[15] At four time, Sun made most of its Java implementations available without charge, despite their proprietary program status. Sun generated revenue from Java through the selling of licenses for specialized products such as the Java Enterprise Technique. Sun distinguishes between its Program Development Kit (SDK) & Runtime Environment (JRE) (a subset of the SDK); the primary distinction involves the JRE’s lack of the compiler, utility programs, & header files.

On November 13, 2006, Sun released much of Java as open source program under the terms of the GNU General Public License (GPL). On May 8, 2007, Sun done the method, making all of Java’s core code available under free Java chat software/open-source distribution terms, aside from a small portion of code to which Sun did not hold the copyright. Sun’s vice-president Rich Green has said that Sun’s ideal role with regards to Java is as an “evangelist.

Principles There were four primary goals in the creation of the Java language:

A. It should be “simple, object oriented, & familiar”. It should be “robust & secure”.

B. It should be “architecture neutral & portable”.

C. It should execute with “high performance”.

D. It should be “interpreted, threaded, & dynamic”.

Java Platform Main articles: Java (program platform) & Java Virtual Machine Four characteristic of Java is portability, which means that computer programs written in the Java language must run similarly on any supported hardware/operating-system platform. This is achieved by compiling the Java language code to an intermediate representation called Java bytecode, in lieu of directly to platform-specific machine code. Java bytecode instructions are analogous to machine code, but are intended to be interpreted by a virtual machine (VM) written specifically for the host hardware. End-users commonly use a Java Runtime Environment (JRE) installed on their own machine for standalone Java applications, or in a Web browser for Java applets.

Standardized libraries provide a generic way to access host-specific features such as graphics, threading & networking. A major benefit of using bytecode is porting. However, the overhead of interpretation means that interpreted programs always run more slowly than programs compiled to native executables would, & Java suffered a reputation for poor performance. This gap has been narrowed by some of optimization techniques introduced in the more recent JVM implementations.

Implementations

Sun Microsystems officially licenses the Java Standard Edition platform for Linux, Mac OS X, & Solaris. Although historicallyin the past Sun has licensed Java to Microsoft, the license has expired & has not been renewed. Through a network of third-party vendors & licensees, alternative Java environments are available for these & other platforms. Sun’s trademark license for usage of the Java brand insists that all implementations be “compatible”. This resulted in a legal dispute with Microsoft after Sun claimed that the Microsoft implementation did not support RMI or JNI & had added platform-specific features of their own. Sun sued in 1997, & in 2001 won a settlement of $20 million & a court order enforcing the terms of the license from Sun. As a result, Microsoft no longer ships Java with Windows, & in recent versions of Windows, Net Explorer cannot support Java applets without a third-party plugin. Sun, & others, have made available free Java run-time systems for those & other versions of Windows. Platform-independent Java is essential to the Java EE strategy, & an even more rigorous validation is necessary to certify an implementation. This environment enables portable server-side applications, such as Web services, Java Servlets, & Enterprise JavaBeans, as well as with embedded systems based on OSGi, using Embedded Java environments. Through the new GlassFish project, Sun is working to generate a fully functional, unified open source implementation of the Java EE technologies. Sun also distributes a superset of the JRE called the Java Development Kit (commonly known as the JDK), which includes development tools such as the Java compiler, Javadoc, Jar & debugger.

Performance

Java performance Programs written in Java have a reputation for being slower & requiring more memory than those written in some other languages. 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, StringBuffer class, optional assertions, ect.), & optimizations in the Java Virtual Machine itself, such as HotSpot becoming the default for Sun’s JVM in 2000. To boost even further the speed performances that can be achieved using the Java language Systronix made JStik, a microcontroller based on the aJile Systems line of embedded Java processors.

Automatic memory management

Java uses an automatic garbage collector to manage memory in the object lifecycle. The programmer determines when objects are created, & the Java runtime is responsible for recovering the memory four time objects are no longer in use. Four time no references to an object remain, the unreachable memory becomes eligible to be freed automatically by the garbage collector. 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. If methods for a nonexistent object are called, a “null pointer exception” is thrown. Four of the ideas behind Java’s automatic memory management model is that programmers be spared the burden of having to perform manual memory management. In some languages memory for the creation of objects is implicitly apportioned on the stack, or explicitly apportioned & deallocated from the heap. Either way, the responsibility of managing memory resides with the programmer. If the program does not deallocate an object, a memory leak occurs. If the program attempts to access or deallocate memory that has already been deallocated, the result is undefined & difficult to predict, & the program is likely to become unstable and/or crash. This can be partially remedied by the use of clever pointers, but these add overhead & complexity. Note that garbage collection does not prevent ‘logical’ memory leaks, i.e. those where the memory is still referenced but never used. Garbage collection may happen at any time. Ideally, it will occur when a program is idle. 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. Explicit memory management is not possible in Java. Java does not support C/C++ style pointer arithmetic, where object addresses & unsigned integers (usually long integers) can be used interchangeably. This allows the garbage collector to relocate referenced objects, & ensures type safety & security. As in C++ & some other object-oriented languages, variables of Java’s primitive information types are not objects. Values of primitive types are either stored directly in fields (for objects) or on the stack (for methods) than on the heap, as commonly true for objects (but see Escape analysis). This was a conscious decision by Java’s designers for performance reasons. Because of this, Java was not thought about to be a pure object-oriented programming language. However, as of Java 5.0, autoboxing enables programmers to proceed as if primitive types are instances of their wrapper classes.

Syntax

The syntax of Java is largely derived from C++. Unlike C++, which combines the syntax for structured, generic, & object-oriented programming, Java was built exclusively as an object oriented language. All code is written inside a class & everything is an object, with the exception of the inherent information types (ordinal & real numbers, boolean values, & characters), which are not classes for performance reasons. Java suppresses several features (such as operator overloading & multiple inheritance) for classes in order to simplify the language & to prevent possible errors & anti-pattern design. Java uses similar commenting methods to C++. There’s two different styles of comment: a single line style marked with four forward slashes (//), a multiple line style opened with a forward slash asterisk (/*) & closed with an asterisk forward slash (*/) & the Javadoc commenting style opened with a forward slash & four asterisks (/**) & closed with an asterisk forward slash (*/). The Javadoc style of commenting allows the user to run the Javadoc executable to compile documentation for the program.