All Topics  
Java compiler

 

   Email Print
   Bookmark   Link






 

Java compiler



 
 
A Java compiler is a compiler
Compiler

A compiler is a computer program that transforms source code written in a programming language into another computer language . The most common reason for wanting to transform source code is to create an executable program....
 for the Java programming language
Java (programming language)

Java is a programming language originally developed by James Gosling at Sun Microsystems and released in 1995 as a core component of Sun Microsystems' Java ....
. The most common form of output from a Java compiler are Java class files
Class (file format)

In the Java , source files are compiled into class files which have a .class extension. Since Java is a platform-independent language, source code is compiled into an output file known as Byte-code, which it stores in a .class file....
 containing platform-neutral Java bytecode
Java bytecode

Java bytecode is the form of instructions that the Java virtual machine executes. Each bytecode instruction or opcode is one byte in length; however, not all of the possible 256 instructions are used....
. There exist also compilers emitting optimized native machine code
Machine code

Machine code or machine language is a system of instructions and data executed directly by a computer's central processing unit. Machine code may be regarded as a primitive programming language or as the lowest-level representation of a compiled and/or assembly language computer program....
 for a particular hardware/Operating system
Operating system

An operating system is an interface between hardware and applications; it is responsible for the management and coordination of activities and the sharing of the limited resources of the computer....
 combination.

Most Java-to-bytecode compilers, Jikes
Jikes

Jikes is an open source Java compiler written in C++. It is no longer being updated.The original version was developed by David L. Shields and Philippe Charles at IBM but was quickly transformed into an open source project contributed to by an active community of developers....
 being a well known exception, do virtually no optimization
Optimization (computer science)

In computing, optimization is the process of modifying a system to make some aspect of it work more efficiently or use fewer resources. For instance, a computer program may be optimized so that it executes more rapidly, or is capable of operating with less Computer data storage or other resources, or draw less power....
, leaving this until runtime
Runtime

In computer science, runtime or run time describes the operation of a computer program, the duration of its execution, from beginning to termination ....
 to be done by the JRE.

The Java Virtual Machine
Java Virtual Machine

A Java Virtual Machine is a set of computer software programs and data structures which use a virtual machine model for the execution of other computer programs and Scripting language....
 (JVM) loads the class files and either interprets
Interpreter (computing)

In computer science, an interpreter normally means a computer program that execution , i.e. performs, instructions written in a programming language....
 the bytecode
Bytecode

Bytecode is a term which has been used to denote various forms of instruction sets designed for efficient execution by a software Interpreter as well as being suitable for further compilation into machine language....
 or just-in-time
Just-in-time compilation

In computing, just-in-time compilation , also known as dynamic translation, is a technique for improving the runtime performance of a computer program....
 compiles it to machine code
Machine code

Machine code or machine language is a system of instructions and data executed directly by a computer's central processing unit. Machine code may be regarded as a primitive programming language or as the lowest-level representation of a compiled and/or assembly language computer program....
 and then possibly optimizes it using dynamic compilation
Dynamic compilation

Dynamic compilation is a process used by some computer programming programming language implementations to gain performance during program execution....
.

The very first Java compiler developed by Sun Microsystems was written in C using some libraries from C++.








Discussion
Ask a question about 'Java compiler'
Start a new discussion about 'Java compiler'
Answer questions from other users
Full Discussion Forum



Encyclopedia


A Java compiler is a compiler
Compiler

A compiler is a computer program that transforms source code written in a programming language into another computer language . The most common reason for wanting to transform source code is to create an executable program....
 for the Java programming language
Java (programming language)

Java is a programming language originally developed by James Gosling at Sun Microsystems and released in 1995 as a core component of Sun Microsystems' Java ....
. The most common form of output from a Java compiler are Java class files
Class (file format)

In the Java , source files are compiled into class files which have a .class extension. Since Java is a platform-independent language, source code is compiled into an output file known as Byte-code, which it stores in a .class file....
 containing platform-neutral Java bytecode
Java bytecode

Java bytecode is the form of instructions that the Java virtual machine executes. Each bytecode instruction or opcode is one byte in length; however, not all of the possible 256 instructions are used....
. There exist also compilers emitting optimized native machine code
Machine code

Machine code or machine language is a system of instructions and data executed directly by a computer's central processing unit. Machine code may be regarded as a primitive programming language or as the lowest-level representation of a compiled and/or assembly language computer program....
 for a particular hardware/Operating system
Operating system

An operating system is an interface between hardware and applications; it is responsible for the management and coordination of activities and the sharing of the limited resources of the computer....
 combination.

Most Java-to-bytecode compilers, Jikes
Jikes

Jikes is an open source Java compiler written in C++. It is no longer being updated.The original version was developed by David L. Shields and Philippe Charles at IBM but was quickly transformed into an open source project contributed to by an active community of developers....
 being a well known exception, do virtually no optimization
Optimization (computer science)

In computing, optimization is the process of modifying a system to make some aspect of it work more efficiently or use fewer resources. For instance, a computer program may be optimized so that it executes more rapidly, or is capable of operating with less Computer data storage or other resources, or draw less power....
, leaving this until runtime
Runtime

In computer science, runtime or run time describes the operation of a computer program, the duration of its execution, from beginning to termination ....
 to be done by the JRE.

The Java Virtual Machine
Java Virtual Machine

A Java Virtual Machine is a set of computer software programs and data structures which use a virtual machine model for the execution of other computer programs and Scripting language....
 (JVM) loads the class files and either interprets
Interpreter (computing)

In computer science, an interpreter normally means a computer program that execution , i.e. performs, instructions written in a programming language....
 the bytecode
Bytecode

Bytecode is a term which has been used to denote various forms of instruction sets designed for efficient execution by a software Interpreter as well as being suitable for further compilation into machine language....
 or just-in-time
Just-in-time compilation

In computing, just-in-time compilation , also known as dynamic translation, is a technique for improving the runtime performance of a computer program....
 compiles it to machine code
Machine code

Machine code or machine language is a system of instructions and data executed directly by a computer's central processing unit. Machine code may be regarded as a primitive programming language or as the lowest-level representation of a compiled and/or assembly language computer program....
 and then possibly optimizes it using dynamic compilation
Dynamic compilation

Dynamic compilation is a process used by some computer programming programming language implementations to gain performance during program execution....
.

The very first Java compiler developed by Sun Microsystems was written in C using some libraries from C++.

Major Java compilers


As of 2006, the following are major Java compiler
Compiler

A compiler is a computer program that transforms source code written in a programming language into another computer language . The most common reason for wanting to transform source code is to create an executable program....
s:

  • javac
    Javac

    javac is the primary Java compiler, included in the Java Development Kit from Sun Microsystems.The compiler accepts source code conforming to the Java and produces Java bytecode conforming to the Java Virtual Machine Specification ....
    , included in JDK
    Java Development Kit

    The Java Development Kit is a Sun Microsystems product aimed at Java developers. Since the introduction of Java, it has been by far the most widely used Java Software development kit....
     from Sun Microsystems
    Sun Microsystems

    Sun Microsystems, Inc. is a multinational corporation vendor of computers, computer components, computer software, and information technology services, founded on February 24, 1982....
    , open-sourced since 13 November 2006.
  • GCJ, a part of gcc
    GNU Compiler Collection

    The GNU Compiler Collection is a compiler system produced by the GNU Project supporting various programming languages. GCC is a key component of the GNU toolchain....
     which compiles C
    C (programming language)

    C is a general-purpose computer programming language originally developed in 1972 by Dennis Ritchie at the Bell Telephone Laboratories to implement the Unix operating system....
    , Fortran
    Fortran

    Fortran is a general-purpose programming language, procedural programming language, imperative programming language programming language that is especially suited to numerical analysis and scientific computing....
    , Pascal and other programming language
    Programming language

    A programming language is a machine-readable artificial language designed to express computations that can be performed by a machine, particularly a computer....
    s besides Java. It can also generate native code using the back-end of gcc.
  • ECJ, the Eclipse Compiler for Java, is an open source incremental compiler
    Incremental compiler

    Generally a compiler for a programming language is a piece of software that reads in one or more program files in a source language and outputs one or more files containing machine code or some other low level language....
     used by the Eclipse
    Eclipse (software)

    Eclipse is a multi-language software development environment comprising an Integrated development environment and a plug-in system to extend it....
     JDT.
  • Jikes
    Jikes

    Jikes is an open source Java compiler written in C++. It is no longer being updated.The original version was developed by David L. Shields and Philippe Charles at IBM but was quickly transformed into an open source project contributed to by an active community of developers....
    , an open source
    Open source

    Open source is an approach to design, development, and distribution offering practical accessibility to a product's source . Some consider open source as one of various possible design approaches, while others consider it a critical Strategy element of their business operations....
     compiler from IBM
    IBM

    International Business Machines Corporation, abbreviated IBM and nicknamed "Big Blue" , is a multinational corporation computer technology and consulting corporation headquartered in Armonk, New York, New York, United States....
    , which is written in C++
    C++

    C++ is a general-purpose programming language. It is regarded as a middle-level language, as it comprises a combination of both high-level programming language and low-level programming language language features....
     and uses a variant of static single assignment form
    Static single assignment form

    In compiler design, static single assignment form is an intermediate representation in which every variable is assigned exactly once. Existing variables in the original IR are split into versions, new variables typically indicated by the original name with a subscript, so that every definition gets its own version....
     for optimization. As of early 2007 the project is no longer being actively developed .
  • Excelsior JET
    Excelsior JET

    Excelsior JET is a commercial Java Platform, Standard Edition technology implementation built around an AOT compiler Java to native code compiler....
     (commercial) also compiles Java to Windows and Linux binary executables and packages them for deployment.


Java decompilers


A Java decompiler
Decompiler

A decompiler is the name given to a computer program that performs the reverse operation to that of a compiler. That is, it translates a file containing information at a relatively low level of abstraction into a form having a higher level of abstraction ....
 tries to reverse the process of compiling, that is it tries to decompile Java bytecode files (*.class) back to Java source files (*.java).

  • JAD, written in C++
    C++

    C++ is a general-purpose programming language. It is regarded as a middle-level language, as it comprises a combination of both high-level programming language and low-level programming language language features....
    , free for non-commercial use.
  • JD , younger project, includes GUI, optional Eclipse-plugin.
  • JODE , decompiler and optimizer, open-source.


External links

  • Java Compiler API Java Specification Request for invoking the Java compiler from a Java program