AutoUpdate

From APIDesign

(Difference between revisions)
Jump to: navigation, search
Line 3: Line 3:
=== Distributing Undistributable ===
=== 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]].
+
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]]:
<source lang="bash">
<source lang="bash">

Revision as of 08:49, 12 September 2016

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 their 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 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 us to distribute pure NetBeans without 3rd party libraries and download them only per user request to their computers.

Personal tools
buy