To install click the Add extension button. That's it.

The source code for the WIKI 2 extension is being checked by specialists of the Mozilla Foundation, Google, and Apple. You could also do it yourself at any point in time.

4,5
Kelly Slayton
Congratulations on this excellent venture… what a great idea!
Alexander Grigorievskiy
I use WIKI 2 every day and almost forgot how the original Wikipedia looks like.
Live Statistics
English Articles
Improved in 24 Hours
Added in 24 Hours
What we do. Every page goes through several hundred of perfecting techniques; in live mode. Quite the same Wikipedia. Just better.
.
Leo
Newton
Brights
Milds

GNU Compiler for Java

From Wikipedia, the free encyclopedia

GNU Compiler for Java
Developer(s)The GNU Project
Initial releaseSeptember 6, 1998; 25 years ago (1998-09-06)[1]
Final release
6.5[2] Edit this on Wikidata / 26 October 2018
Operating systemUnix-like
TypeCompiler
LicenseGNU GPL
Websitegcc.gnu.org

The GNU Compiler for Java (GCJ) is a discontinued free compiler for the Java programming language. It was part of the GNU Compiler Collection.[3][4]

GCJ compiles Java source code to Java virtual machine (JVM) bytecode or to machine code for a number of CPU architectures. It could also compile class files and whole JARs that contain bytecode into machine code.[5][6]

YouTube Encyclopedic

  • 1/3
    Views:
    63 231
    27 382
    179 068
  • 02 | How Java Program Works, Compiler, Interpreter | Java Tutorial for Beginners
  • How To install MinGW on Windows 10 (GCC & G++)
  • How to Install GCC

Transcription

Hi this is anil and welcome to the second video tutorial on java programming language. This video tutorial is the production of the youtube channel Learning Lad and and in this video tutorial we are gonna learn about the compilers, the interpreters and also we are gonna learn how a java program works or you know the process or the steps involved in running a java program. All right lets get started. So the first thing is executing the programs. So the computers can only understand the code in the binary form which is you know 0's and 1's and all of you know that when we write the code in the higher level programming languages such as java or c++ you kno the statements are gonna be somewhat English like and you know that form of statements are easy for us to read and understand the program but for the computer you know it can't understand the code in the higher level form. So we need to convert that to the binary form. So all of you know that you know when you write a program in c or c++ or java or any other programming language, and that is called the source program or the source code. So what we can do is we can translate our source code you know which is in higher level form to a machine level form which the computers can understand and execute. All right. The translation can be done using another programming tool which is called as interpreter or a compiler. So this interpreter and compilers are normally used to translate the code from one form to another form. And these two are gonna work differently and we are gonna see that next. So first of all what is a compiler? A compiler is a program which translates the entire souce code into the machine code or you know any other intermediate code you know which can be used to execute the program. So lets see how the compiler works. So first you know we are gonna have the source code written in the higher level languages such as c, c++ java or any other. and then we are gonna use the compiler and translate this code to the machine level code or any other intermediate form you know which will be optimized form of this source code and then we are gonna use another software or program called executor to execute the compiled code. So this is how the compiler works. You know this compiler is gonna read the entire source code and its gonna convert that to the machine level code or any other intermediate form and then that converted code will be used along with the executor and the output is generated or got. And then we are gonna see about the interpreter. So what is a interpreter? An interpreter is a program which reads one statement from the source code at a time and translated it to machine code or virtual machine code and then executes that right away. So first we are gonna have the source program and then we are gonna use the interpreter and this interpreter is gonna read one statement from the source or you know one statement from the input to that interpreter and then its gonna translate that and its gonna execute that statement right away and then its gonna continue with the next statement its gonna translate that to machine code and execute that and again its gonna take the next statement its gonna translate that and execute that. And similarly its gonna do for the entire code. So the difference between the compiler and the interpreter is that you know the compiler is gonna take the entire source code first and its gonna convert that to the intermediate form or the machine level form and then we are gonna use another software called executor to run the compile code. But with interpreter, you know its gonna read one statement at a time from the source and then its gonna convert that to the machine level form, and then its gonna execute that line of statement right away and then it will continue with the next statement. So the next thing is you know how java works? or you know the steps involved when you write a java program and execute a program. So first we are gonna have the java source code. and you know java source code will be saved with the extension of .java And then we are gonna use the java compiler and we are gonna compile the code and we are gonna get the java byte code. So this java byte code is gonna have the .class extension. So this java byte code is a modified version or you know the optimized version of this java source code. And then we are gonna pass this java byte code to the java virtual machine or jvm which is a interpreter. So its gonna read one statement at a time from this java byte code and its gonna convert that to the machine level code and its gonna execute that. And then again its gonna continue with the next statement and its gonna convert that and execute that and similarly its gonna execute your java program. So we are gonna get the output after executing our program by our java interpreter or you know the java virtual machine. And also in the previous tutorial i have told you that you know we are gonna write the java code only once and then we can execute that same code in different different platforms. So we can execute our code in windows, and also we can execute our code in mac and also we can execute our code in Linux platform. So how it is possible? So what we have is the jvm or the java virtual machine which is the one which is gonna execute our java byte code. So java provides platform specific java virtual machines. So if you are using windows platform then you are gonna have the windows specific jvm, and for Linux we are gonna have the linux specific jvm, and for mac we are gonna have the mac specific jvm or java virtual machine. So all these platform specific jvm or java virtual machines are capable of executing the java byte code in the same way. So when we pass the java byte code to the jvm in windows its gonna execute that and also when you pass the same java byte code to linux and mac its gonna execute it in the same way. So this is how our java program is capable of running in different different platforms. we are gonna have the different platform specific java virtual machines. that's it. So this is it guys this is about some information on the compilers, the interpreters and steps involved in running a java program. So thank you for watching and don't forget to subscribe to my channel. If you guys have any doubt or any suggestion, don't hesitate to tell us and you guys can like our facebook page at facebook.com/LearningLad and also you guys can tweet us @LearningLadEdu and i will see you in the next tutorial.

History

The GCJ runtime-libraries original source is from GNU Classpath project, but there is a code difference between the libgcj libraries. GCJ 4.3 uses the Eclipse Compiler for Java as a front-end.[7]

In 2007, a lot of work was done to implement support for Java's two graphical APIs in GNU Classpath: AWT and Swing. Software support for AWT is still in development. "Once AWT support is working then Swing support can be considered. There is at least one free-software partial implementations of Swing that may be usable.".[8] The GNU CLASSPATH was never completed to even Java 1.2 status and now appears to have been abandoned completely.

As of 2015, there were no new developments announced from GCJ and the product was in maintenance mode, with open-source Java toolchain development mostly happening within OpenJDK.[9] GCJ was removed from the GCC trunk on September 30, 2016.[10][11] Announcement of its removal was made with the release of the GCC 7.1, which does not contain it.[12] GCJ remains part of GCC 6.

Performance

The compilation function in GCJ should have a faster start-up time than the equivalent bytecode launched in a JVM when compiling Java code into machine code.[13]

Compiled Native Interface (CNI)

The Compiled Native Interface (CNI), previously named "Cygnus Native Interface", is a software framework for the GCJ that allows Java code to call, and be called by, native applications (programs specific to a hardware and operating-system platform) and libraries written in C++.

CNI closely resembles the JNI (Java Native Interface) framework which comes as a standard with various Java virtual machines.

Comparison of language use

The authors of CNI claim for various advantages over JNI:[14]

We use CNI because we think it is a better solution, especially for a Java implementation that is based on the idea that Java is just another programming language that can be implemented using standard compilation techniques. Given that, and the idea that languages implemented using Gcc should be compatible where it makes sense, it follows that the Java calling convention should be as similar as practical to that used for other languages, especially C++, since we can think of Java as a subset of C++. CNI is just a set of helper functions and conventions built on the idea that C++ and Java have the *same* calling convention and object layout; they are binary compatible. (This is a simplification, but close enough.)

CNI depends on Java classes appearing as C++ classes. For example,[15] given a Java class,

public class Int
{
   public int i;
   public Int(int i) { this.i = i; }
   public static Int zero = new Int(0);
}

one can use the class thus:

#include <gcj/cni.h>
#include <Int>

Int *mult(Int *p, int k)
{
  if (k == 0)
    return Int::zero;  // Static member access.
  return new Int(p->i * k);
}

See also

References

  1. ^ Anthony Green, Cygnus Solutions. "GCJ announcement".
  2. ^ "GCC Releases - GNU Project".
  3. ^ "GCJ: The GNU Compiler for Java - GNU Project - Free Software Foundation (FSF)". Archived from the original on 2007-05-09. Retrieved 2010-04-22.
  4. ^ Campbell, Bill (2013). Introduction to Compiler Construction in a Java World. CRC Press Taylor & Francis Group. ISBN 978-1-4398-6088-5. Retrieved 2014-02-06.
  5. ^ "Compiling Java with GCJ | Linux Journal".
  6. ^ "GNU Compiler for Java".
  7. ^ "gcj to use Eclipse compiler as a front end". 2007-01-08. Archived from the original on 2007-05-09. Retrieved 2007-05-20.
  8. ^ The GCJ FAQ
  9. ^ GCC Looks To Turn Off Java, Replace With Go Or ADA
  10. ^ Andrew Haley (September 30, 2016). "[gcc] Revision 240661".
  11. ^ Tromey, Tom (October 2, 2016). "The Deletion of gcj". The Cliffs of Inanity. Retrieved October 3, 2016.
  12. ^ "GCC 7 Release Series: Changes, New Features, and Fixes". Retrieved May 9, 2017.
  13. ^ "GCJ: The GNU Static Java Compiler" (PDF). Archived from the original (PDF) on 2011-06-07. Retrieved 2009-08-02.
  14. ^ The GCJ FAQ – GNU Project – Free Software Foundation (FSF)
  15. ^ The example comes from: https://gcc.gnu.org/onlinedocs/gcj/Objects-and-Classes.html#Objects-and-Classes Archived 2016-10-20 at the Wayback Machine

External links

This page was last edited on 13 February 2023, at 07:58
Basis of this page is in Wikipedia. Text is available under the CC BY-SA 3.0 Unported License. Non-text media are available under their specified licenses. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc. WIKI 2 is an independent company and has no affiliation with Wikimedia Foundation.