GNU Compiler for Java: Difference between revisions

Content deleted Content added
m clean up; http->https (see this RfC) using AWB
m clean up; http->https (see this RfC) using AWB
Line 15:
| website = {{URL|gcc.gnu.org/java}}
}}
The '''GNU Compiler for Java''' ('''GCJ''') was a [[freeware|free]] [[compiler]] for the [[Java (programming language)|Java programming language]] and a part of the [[GNU Compiler Collection]].<ref>httphttps://gcc.gnu.org/java/</ref><ref>{{cite book |last=Campbell |first=Bill |date=2013 |title=Introduction to Compiler Construction in a Java World |url=https://books.google.com/books?id=-b8WjLY2eKEC&pg=PA277&lpg=PA277&dq=gnu+java+compiler&source=bl&ots=Es6HExUiAZ&sig=Nz2kiAVzQv0gB8aLU57C8j6L7Tc&hl=en&sa=X&ei=VpXzUsClO6mCygHKxIGYBg&ved=0CDsQ6AEwAzgU#v=onepage&q=gnu%20java%20compiler&f=false |___location= |publisher=CRC Press Taylor & Francis Group |isbn=978-1-4398-6088-5 |accessdate=2014-02-06}}</ref>
 
GCJ can compile Java [[source code]] to [[Java Virtual Machine]] [[bytecode]] or to [[machine code]] for a number of [[CPU architecture]]s. It can also compile [[Class (file format)|class files]] and whole [[JAR (file format)|JARs]] that contain bytecode into machine code.<ref>http://www.linuxjournal.com/article/4860</ref><ref>http://freecode.com/projects/gcj</ref>
Line 22:
The GCJ runtime-libraries original source is from [[GNU Classpath]] project, but there is a code difference between the <code> libgcj </code> libraries. GCJ 4.3 uses the [[Eclipse (software)|Eclipse]] Compiler for Java as a front-end.<ref>
{{
cite web | title = gcj to use Eclipse compiler as a front end | url = httphttps://gcc.gnu.org/java/ | date= 2007-01-08 | accessdate = 2007-05-20
}}
</ref>
 
In 2007, a lot of work was done to implement support for Java's two graphical [[application programming interface|API]]s in [[GNU Classpath]]: [[Abstract Window Toolkit|AWT]] and [[Swing (Java)|Swing]]. Software support for [[Abstract Window Toolkit|AWT]] is still in development.<!--Note, "Optional SWT support" also available for micro-libgcj (that is a subset - not maintained, not sure if this SWT support also applies to GCJ)--> "Once AWT support is working then Swing support can be considered. There is at least one free-software partial implementations of [[Swing Application Framework|Swing]] that may be usable.".<ref>[httphttps://gcc.gnu.org/java/faq.html#2_4 The GCJ FAQ - GNU Project - Free Software Foundation (FSF)]</ref> The GNU CLASSPATH was never completed to even Java 1.2 status and now appears to have been abandoned completely.
 
<!--Not sure if this non-development for years contradicts above "AWT is still in development" as that is not a compiler (but would appear in "News"?)-->{{As of|2015}}, there have been no new developments announced from GCJ<ref>[httphttps://gcc.gnu.org/java GCJ: News]</ref> and the product is currently in deep [[maintenance mode]].<ref>[http://www.phoronix.com/scan.php?page=news_item&px=MTUwOTA GCC Looks To Turn Off Java, Replace With Go Or ADA]</ref>
 
==Performance==
Line 39:
 
===Comparison of language use===
The authors of CNI claim for various advantages over JNI:<ref>[httphttps://gcc.gnu.org/java/faq.html#2_3 The GCJ FAQ - GNU Project - Free Software Foundation (FSF)<!-- Bot generated title -->]</ref>
 
{{cquote|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.)
Line 45:
 
CNI depends on Java classes appearing as C++ classes. For example,<ref>
The example comes from: httphttps://gcc.gnu.org/onlinedocs/gcj/Objects-and-Classes.html#Objects-and-Classes</ref>
given a Java class,
 
Line 89:
 
==External links==
* [httphttps://gcc.gnu.org/java/ GCJ Homepage]
* [httphttps://gcc.gnu.org/onlinedocs/gcj/ GCJ Manual]
* [httphttps://gcc.gnu.org/onlinedocs/gcj/About-CNI.html About CNI section of GCJ Manual]
* [https://lwn.net/Articles/130796/ LWN: GCJ - past, present, and future] – the article discusses some history of GCJ