You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 9 Next »

An explanation of the key aspects to the place and purpose of nb-javac.

What is nb-javac?

"nb-javac" consists of two libraries that provide a NetBeans-specific fork of the Java JDK Java compiler, and is explicitly excluded by Oracle from the NetBeans code donation to Apache.

Where is nb-javac found in the NetBeans sources?

In the "java" cluster, see: Overview: NetBeans Structure

How can nb-javac be distributed, given that it will not be Apache licensed?

Of course of paramount importance is that the user encounters no problems at all and that NetBeans as always works out of the box. The most obvious mechanism to installing nb-javac is to do it in the same way as done for JUnit (before JUnit licensing changed and it became a standard part of NetBeans), i.e., during installation a question can be asked "Which languages would you like to work with?" and if Java is chosen nb-javac will be downloaded and installed:

wiki.apidesign.org/wiki/AutoUpdate

What does nb-javac do that's different to vanilla javac?

A few years back, the NetBeans team wrote a page describing what nb-javac does in addition to/differently to vanilla javac:

http://wiki.netbeans.org/JavacDiff

Looking at the page now, some of the things listed above are not part of nb-javac anymore (e.g., cancelling and some part of the error recovery paragraph) but it still gives a reasonable overview and is good to get an idea what kinds of things nb-javac does. 

What is the reason that nb-javac is a fork and not part of the javac main repository?

  1. The pace at which javac/JDK moves and at which NetBeans moves is simply different. E.g., imagine a refactoring breaking a user's code because of error recovery misbehaving. Once the problem is found it may be fixed in nb-javac in hours or days. Fixing it in javac can easily take weeks or even months (and much more effort in testing and review). 
  2. Even some changes that from the NetBeans point may look innocent may be hard to get into vanilla javac. For example, when javac detects a syntax error, it normally ends without getting to a semantic analysis. This does not work for an IDE (noone probably wants to lose almost all features just because a semicolon is missing). But it may be difficult to push through a fix to semantic analysis for a syntactically broken code (sometimes this passed before, other times, there was a pushback on such changes, depending on the nature of the change needed). 
  3. Some of the changes in nb-javac may be very hard to get in unless there is another user than just NetBeans.

 

 

 

  • No labels