AutoUpdate

From APIDesign

Jump to: navigation, search

NetBeans created AutoUpdate technology in 1999. These days it is a typical system for keeping your Android, iOS or Linux distribution up to date. At the end of last century it was a novel approach of distributing software. Originally the update was driven only through GUI, but later we added a command line interface. That allows the installer to use the AutoUpdate to get the most recent version of binaries during installation. It also allows to download parts of the system that aren't installed by default.

Distributing Undistributable

From time to time NetBeans have problems with licenses. Once we could not distribute JUnit because it was using archaic CPL license. From time to time we don't want to distribute GPL code. AutoUpdate is a perfect way to workaround it. Let's demonstate that on the case of NetBeans Javac:

$ unzip ~/Downloads/netbeans-8.1-201510222201.zip # prepare NetBeans 8.1
$ find netbeans/ | grep nbjavac # find NetBeans Javac binaries
netbeans/java/update_tracking/org-netbeans-lib-nbjavac.xml
netbeans/java/config/Modules/org-netbeans-lib-nbjavac.xml
netbeans/java/modules/locale/org-netbeans-lib-nbjavac_zh_CN.jar
netbeans/java/modules/locale/org-netbeans-lib-nbjavac_ru.jar
netbeans/java/modules/locale/org-netbeans-lib-nbjavac_pt_BR.jar
netbeans/java/modules/locale/org-netbeans-lib-nbjavac_ja.jar
netbeans/java/modules/org-netbeans-lib-nbjavac.jar
$ find netbeans/ | grep nbjavac | xargs rm # remove them

Now, if you started NetBeans, the IDE functionality would be seriously impacted. In fact one couldn't edit any Java source, because all the lexing and parsing of Java code is handled by missing nbjavac module. However with AutoUpdate, there is an easy fix, just execute:

$ ./netbeans/bin/netbeans --modules --refresh --install .*nbjavac.*

this is the command line interface to AutoUpdate. It instructs it to connect to update centers, and download nbjavac module. Once you restart your NetBeans, the Java editing capabilities are back. This allows the installer to distribute pure NetBeans without any 3rd party libraries and just download the necessary once only per user request.

Personal tools
buy