nb-javac is a backport of OpenJDK "javac", i.e., the Java compiler. nbjavac takes sources from the latest JDK and backports them to run on JDK8+. The nb-javac has long been part of NetBeans, providing a highly tuned Java compiler specifically for the Java editor i.e., parsing and lexing for features such as syntax coloring, code completion.
- Git
- Ant 1.9.9 or above
- JDK 17 to build
- JDK 8 to test
- Apache Maven to publish to Maven central
Detailed description of the build process is available in a separate development documentation. Here are just the most straigtforward steps to get the final artifacts.
$ git clone https://github.com/oracle/nb-javac.git
$ git checkout <release_tag_name>
$ JAVA_HOME=/jdk-17/ ant -f ./make/langtools/netbeans/nb-javac clean jar
Two jars namely nb-javac-*-api.jar
and nb-javac-*-impl.jar
are going to appear
at location ./make/langtools/netbeans/nb-javac/dist/
. It is also possible to
sanity test the generated Javac on JDK8:
$ JAVA_HOME=/jdk-8/ ant -f ./make/langtools/netbeans/nb-javac test
$ JAVA_HOME=/jdk-17/ ant -f ./make/langtools/netbeans/nb-javac zip-nb-javac-sources
-
Aquire an account for OSSRH from sonatype and get access to the target groupId See here: https://central.sonatype.org/pages/ossrh-guide.html
-
Configure the maven installation so that the credentials are made available for the server with the id oss.sonatype.org
-
Run
JAVA_HOME=/jdk-17/ ant -f ./make/langtools/netbeans/nb-javac publish-to-ossrh-snapshots -Dmaven.groupId=your.grp.id
to publish snapshot artifacts (https://oss.sonatype.org/content/repositories/snapshots/)
-
Run
JAVA_HOME=/jdk-17/ ant -f ./make/langtools/netbeans/nb-javac publish-to-maven-central -Dmaven.groupId=your.grp.id
to stage the release, which will get promoted to maven central, after it has been manually released.
cp nb-javac/make/langtools/netbeans/nb-javac/dist/nb-javac-$ver-api.jar netbeans/java/libs.javacapi/external/nb-javac-$ver-api.jar
cp nb-javac/make/langtools/netbeans/nb-javac/dist/nb-javac-$ver-impl.jar netbeans/java/libs.javacimpl/external/nb-javac-$ver-impl.jar
2. Open Netbeans and activate Java SE by creating or opening a ant, maven or gradle then copy jars by these commands
cp nb-javac/make/langtools/netbeans/nb-javac/dist/nb-javac-$ver-impl.jar netbeans/nbbuild/testuserdir/modules/ext/nb-javac-$ver-impl.jar
cp nb-javac/make/langtools/netbeans/nb-javac/dist/nb-javac-$ver-api.jar netbeans/nbbuild/testuserdir/modules/ext/nb-javac-$ver-api.jar
touch netbeans/nbbuild/testuserdir/.lastmodified
- https://cwiki.apache.org/confluence/display/NETBEANS/Overview%3A+nb-javac
- https://cwiki.apache.org/confluence/display/NETBEANS/Release+Schedule
- https://wiki.se.oracle.com/display/JPG/Behavior+without+NB-Javac
- Subscribe or mail the [email protected] list - Ask questions, find answers, and also help other users.
- Subscribe or mail the [email protected] list - Join development discussions, propose new ideas and connect with contributors.
See the Contributing Policy
See the Security Policy