<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.aletopedia.org/index.php?action=history&amp;feed=atom&amp;title=Java_compiler</id>
	<title>Java compiler - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.aletopedia.org/index.php?action=history&amp;feed=atom&amp;title=Java_compiler"/>
	<link rel="alternate" type="text/html" href="https://www.aletopedia.org/index.php?title=Java_compiler&amp;action=history"/>
	<updated>2026-12-03T02:27:34Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.2</generator>
	<entry>
		<id>https://www.aletopedia.org/index.php?title=Java_compiler&amp;diff=921505&amp;oldid=prev</id>
		<title>2605:8D80:13E4:8D44:4C2C:ADB0:F3C7:94EE at 13:54, 21 October 2025</title>
		<link rel="alternate" type="text/html" href="https://www.aletopedia.org/index.php?title=Java_compiler&amp;diff=921505&amp;oldid=prev"/>
		<updated>2025-10-21T13:54:42Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Short description|Program compiler for Java programming language}}&lt;br /&gt;
A &amp;#039;&amp;#039;&amp;#039;Java compiler&amp;#039;&amp;#039;&amp;#039; is a [[compiler]] for the [[Java (programming language)|Java programming language]].  &lt;br /&gt;
&lt;br /&gt;
Some Java compilers output optimized [[machine code]] for a particular hardware/[[operating system]] combination, called a &amp;#039;&amp;#039;[[Computing platform|domain specific]]&amp;#039;&amp;#039; &amp;#039;&amp;#039;[[computer system]]&amp;#039;&amp;#039;. An example would be the now discontinued [[GNU Compiler for Java]].&amp;lt;ref&amp;gt;{{Cite web|title=GCJ - past, present, and future|url=https://lwn.net/Articles/130796/|access-date=2021-09-24|language=en|archive-date=2019-08-02|archive-url=https://web.archive.org/web/20190802072307/https://lwn.net/Articles/130796/|url-status=live}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The most common form of output from a Java compiler is [[Java class file]]s containing [[cross-platform]] [[intermediate representation]] (IR), called [[Java bytecode]].&amp;lt;ref&amp;gt;{{Cite web|title=The Java Virtual Machine Specification, Java SE 8 Edition, Section 1.2|url=https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-1.html#jvms-1.2|access-date=2021-09-24|language=en|archive-date=2021-09-24|archive-url=https://web.archive.org/web/20210924135604/https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-1.html#jvms-1.2|url-status=live}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The [[Java virtual machine]] (JVM) loads the class files and either [[interpreter (computing)|interprets]] the [[bytecode]] or [[just-in-time compilation|just-in-time]] compiles it to [[machine code]] and then possibly optimizes it using [[dynamic compilation]].&lt;br /&gt;
&lt;br /&gt;
A standard on how to interact with Java compilers was specified in [[Java Specification Request|JSR]] 199.&amp;lt;ref&amp;gt;{{Cite web|url=https://jcp.org/en/jsr/detail?id=199|title=JSR 199: JavaTM Compiler API|access-date=2021-09-24|archive-date=2021-09-24|archive-url=https://web.archive.org/web/20210924135603/https://jcp.org/en/jsr/detail?id=199|url-status=live}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is provided by [[Java Platform Module System|module]] &amp;lt;code&amp;gt;jdk.compiler&amp;lt;/code&amp;gt;, and requires the full [[Java Development Kit]] (as opposed to just the [[Java Runtime Environment]]), and reside in the &amp;lt;code&amp;gt;javax.tools.*&amp;lt;/code&amp;gt; namespace.&amp;lt;ref&amp;gt;{{Cite web|title=JavaCompiler (Java SE)|url=https://docs.oracle.com/en/java/javase/25/docs/api/java.compiler/javax/tools/JavaCompiler.html|website=docs.oracle.com|access-date=21 October 2025|publisher=Oracle Corporation}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
package org.wikipedia.examples;&lt;br /&gt;
&lt;br /&gt;
import java.io.IOException;&lt;br /&gt;
import java.io.File;&lt;br /&gt;
&lt;br /&gt;
import javax.tools.JavaCompiler;&lt;br /&gt;
import javax.tools.ToolProvider;&lt;br /&gt;
&lt;br /&gt;
public class Example {&lt;br /&gt;
    private final String TEST_FILE_NAME = &amp;quot;Test.java&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    public static void main(String[] args) throws IOException {&lt;br /&gt;
        File sourceFile = new File(TEST_FILE_NAME);&lt;br /&gt;
        if (!sourceFile.exists()) {&lt;br /&gt;
            throw new IllegalArgumentException(String.format(&amp;quot;File path %s does not exist!&amp;quot;, TIME_FILE_NAME));&lt;br /&gt;
        }&lt;br /&gt;
        JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();&lt;br /&gt;
&lt;br /&gt;
        if (compiler == null) {&lt;br /&gt;
            throw new RuntimeException(&amp;quot;Compiler not available. Are you running on a JRE instead of a JDK?&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        int result = compiler.run(null, null, null, sourceFile);&lt;br /&gt;
&lt;br /&gt;
        System.out.printf(&amp;quot;Compilation result: %s%n&amp;quot;, result == 0 ? &amp;quot;Success&amp;quot; : &amp;quot;Failure&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[List_of_compilers#Java_compilers|List of Java Compilers]]&lt;br /&gt;
* [[javac]], the standard Java compiler in Oracle&amp;#039;s [[Java_Development_Kit|JDK]]&lt;br /&gt;
* [[Roslyn (compiler)]], compiler for C# also invokable programmatically&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
{{reflist}}&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
* [http://openjdk.java.net/groups/compiler/ Sun&amp;#039;s OpenJDK javac page]&lt;br /&gt;
* Stephan Diehl, [http://people.cis.ksu.edu/~hatcliff/605/XC/java-comp.pdf.gz &amp;quot;A Formal Introduction to the Compilation of Java&amp;quot;], &amp;#039;&amp;#039;Software - Practice and Experience&amp;#039;&amp;#039;, Vol. &amp;#039;&amp;#039;&amp;#039;28&amp;#039;&amp;#039;&amp;#039;(3), pages 297-327, March 1998.&lt;br /&gt;
&lt;br /&gt;
{{DEFAULTSORT:Java Compiler}}&lt;br /&gt;
[[Category:Java compilers| ]]&lt;br /&gt;
[[Category:Java specification requests]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{compu-prog-stub}}&lt;/div&gt;</summary>
		<author><name>2605:8D80:13E4:8D44:4C2C:ADB0:F3C7:94EE</name></author>
	</entry>
</feed>