JavaC

From APIDesign

(Difference between revisions)
Jump to: navigation, search
Current revision (05:11, 3 December 2026) (edit) (undo)
(→Nb-Javac)
 
(One intermediate revision not shown.)
Line 3: Line 3:
== Nb-[[Javac]] ==
== Nb-[[Javac]] ==
-
There is a port of latest (as of today JDK 26+35) [[javac]] to run on any JDK8+ maintained by [[I|me]] at https://github.com/JaroslavTulach/nb-javac/ - originally developed because of [[NetBeans]] needs, but useful on its own as a separate component.
+
There is a port of the latest (as of today JDK 26+35) [[javac]] to '''run on any JDK8'''+ maintained by [[I|me]] at https://github.com/JaroslavTulach/nb-javac/ - originally developed because of [[NetBeans]] needs, but useful on its own as a separate component.
 +
 
 +
=== [[CtSym]] for the Latest [[JDK]] ===
 +
 
 +
{{:CtSym}}
=== [[Javac]] in [[NetBeans]] ===
=== [[Javac]] in [[NetBeans]] ===
Line 10: Line 14:
In 2021, [[DirectAction|it was decided]] the [[ApacheNetBeans]] project can distribute the [https://cwiki.apache.org/confluence/display/NETBEANS/Overview%3A+nb-javac nb-javac component] as part of [[NetBeans]] binaries. The same [[javac]] can then be used on any [[JDK]]. That has significantly simplified distribution, bundling, testing of the [[NetBeans]] IDE on various [[JDK]] versions.
In 2021, [[DirectAction|it was decided]] the [[ApacheNetBeans]] project can distribute the [https://cwiki.apache.org/confluence/display/NETBEANS/Overview%3A+nb-javac nb-javac component] as part of [[NetBeans]] binaries. The same [[javac]] can then be used on any [[JDK]]. That has significantly simplified distribution, bundling, testing of the [[NetBeans]] IDE on various [[JDK]] versions.
-
The page about [https://cwiki.apache.org/confluence/display/NETBEANS/Overview%3A+nb-javac nb-javac component] contains details and historic notes about such an '''autogenerated''' backport of [[JavaC]] from the latest [[JDK]] that can run on [[JDK]]8.
+
The page about [https://cwiki.apache.org/confluence/display/NETBEANS/Overview%3A+nb-javac nb-javac component] contains details and historic notes about such an '''autogenerated''' backport of [[JavaC]] from the latest [[JDK]] that can run on [[JDK]]8.
== [[DEW]] ==
== [[DEW]] ==
Thanks to [[TulachMoreDEW]] project, [[JavaC]] can run in a browser. But who cares!?
Thanks to [[TulachMoreDEW]] project, [[JavaC]] can run in a browser. But who cares!?

Current revision

JavaC is the Java source to bytecode compiler.

Contents

Nb-Javac

There is a port of the latest (as of today JDK 26+35) javac to run on any JDK8+ maintained by me at https://github.com/JaroslavTulach/nb-javac/ - originally developed because of NetBeans needs, but useful on its own as a separate component.

CtSym for the Latest JDK

CtSym is a JAR file with historical snapshots of the Java APIs since JDK8 up until the more recent JDK. The Nb-Javac project is publishing its own ctsym as a separate and dedicated Maven Central repository artifact.

The information inside of CtSym is used by JavaC compiler when it processes its --release XY parameter. It is a huge (10M+) artifact with intrinsic data encoded in hundreds of files under META-INF/ct.sym/*/*. Without it the JavaC wouldn't be able to compile code targeting older JDKs reliably.

Having this artifact available as a dedicated artifact on Maven Central repository is a huge step forward for all Java compiler related tools (like Sigtest). The CtSym is part of the JDK since JDK9, but who wants to download the latest JDK to get this API snapshots? As a result various tools (like Sigtest) included its own copy of CtSym in its JAR file - making all such tools quite bloated. Say no more! Now all these tools can share the single CtSym artifact produced by the Nb-Javac project. Moreover it is easy to upgrade to new version. Rather than rebuilding the tools (to package new META-INF/ct.sym/* files) it is enough to just update a tool dependency to latest version of CtSym Maven artifact.

Using the released snapshots of the Java APIs has never been easier! Enjoy the newly gain API Freedom!

Javac in NetBeans

For years NetBeans editing capabilities were based on nb-javac - a manual fork of official OpenJDK javac codebase distributed under GPLwithClassPathException license. In 2021, it was decided the ApacheNetBeans project can distribute the nb-javac component as part of NetBeans binaries. The same javac can then be used on any JDK. That has significantly simplified distribution, bundling, testing of the NetBeans IDE on various JDK versions.

The page about nb-javac component contains details and historic notes about such an autogenerated backport of JavaC from the latest JDK that can run on JDK8.

DEW

Thanks to TulachMoreDEW project, JavaC can run in a browser. But who cares!?

Personal tools
buy
Page information