Table of Contents
- Ant Anywhere
- To Do
- Maven Repository (Maven Everywhere?)
- "CJAN" (Comprehensive Java Archive Network)
- Swing Application Framework (JSR-296)
- NetBeans Module API
- Embedded Web Server (Apache Anywhere)
- Web UI (GWT)
- Mac OS X Bundles
- Windows EXE
- Build Transformations
- Zero Install System
- Package Managers
- Java Native Code
- Ant-based build automation
(Apache) Ant Anywhere (AAA?) bridges the gap between the ever-so-useful, but command-line oriented, Apache Ant, and command-line averse WWW users.
I believe that the difficulty in installing most Open Source Software applications is a critical problem. By making it super-easy for developers to make their Java applications installable with just a click, I hope to enable them to get a broader user base and to show the way to better applications.
This O'Reilly article makes mention of the install problem.
RUNNING.TXT of Apache Tomcat is an anti-pattern. That file isn't conveniently web linkable, but the Tomcat Setup doc might lure one into thinking all is well (but note the "If using a J2SE 1.4 JRE" note). This gives a better idea of what's wrong: Idiot's guide to installing Java and Tomcat. This too: How-to install Tomcat on Mac OS X. Some folks have made a stab at fixing the problem for Tomcat.
The Ant Anywhere Demo is a simple loader that packages up a directory of resources and then runs Ant on the build.xml in that directory. AntForm is included so that Swing menus can be easily used.
Ant Anywhere is Ant Anywhere itself with an AntForm GUI so you can create Java Web Start files for your own project by just filling in the blanks.
If you get an error from Java Web Start complaining about not being able to load a resource, give it a second try (I've seen a case were it failed to load the logo icon on the first try).
You can see the files on the web server at http://pagesmiths.com/code/ant-anywhere-demo/.
The default index HTML file has been renamed to "xindex.html" so you can see the directory contents as well as that source (otherwise pointing a browser there would just get the redirect to the JNLP launch file). You'll notice META-INF and WEB-INF directories because this is actually an unpacked WAR which can be used to deploy the demo as a self-serving web app by dropping in on your favorite JEE servlet container.
A binary including all source and dependencies at http://sourceforge.net/project/showfiles.php?group_id=168062&package_id=215050.
That is a snapshot of the development directory and currently lacks any information on how to build or use it.
Maven Repository (Maven Everywhere?)The current prototype just copies the whole resources directory into a separate space for each application. Also if one were to follow the example of using the convenient-but-flawed JNLP-WAR Ant task, each jar in the lib is signed and copied without version information. That is not desireable considering that many applications are built from common components. The solution is to use a common repository so that shared files don't need to be downloaded and stored multiple times.
The right tool for that job appears to be Apache Maven.
IvyIvy is dependency management done the Ant-way. It also supports Maven & Maven2. AntAnywhere is using Ivy.
Ivy+SVN provides Subversion support for Ivy: http://www.ivytools.org/ivy+svn.html.
"CJAN" (Comprehensive Java Archive Network)Handling project sources, binaries, and dependencies automatically as in "CPAN for Java" is part of what we're after here. And several folks have started projects called "CJAN", but none seem to have been successful.
IzPackIzPack is an OSS installer maker for Java.
Integrating IzPack with AntAnywhere will make a full-featured solution (when we've got services management too of course).
- Article on IzPack support in NetBeans
OSGiOSGi, JNLP, and Jar Versioning are coming together as JSR-XXX.
Spring-OSGiThe Spring folks are also making OSGi easier to use including Maven support. http://www.springframework.org/osgi
Swing Application Framework (JSR-296)The Swing Application Framework provides application lifecycle API for Swing applications. Noteworthy because it is applet & sandbox compatible.
NetBeans Module APINetBeans RCP (hence Swing) complement to Eclipse's RIA. http://platform.netbeans.org/
Embedded Web Server (Apache Anywhere)Since many of the applications we'ld like to distribute are web applications, we need a web server to run them on. So we need to package up a web server or two. Jetty is easy to package, but not all web applications work with it, so the popular Apache Tomcat is needed too.
Web UI (GWT)
The prototype uses Ant Form to present a Swing UI. While that may be fine for a few things that can only be performed locally on the desktop (like embedded web server configuration that can't be done after the web server starts), in IFCX we always want to make sure there is a Web UI.
GWT is the natural toolkit for this.
For those wondering why we need a Web UI for personal applications and don't think that remote access is a common enough use case, here are a few more reasons:
- Given that the user clicked in a web browser to launch the application, unless we know otherwise we should assume they'ld like the application to present itself in the web browser. Forcing a switch of UI modes should only be done when retaining the current mode is not possible.
- While Sun's Java Web Start will always have Swing, that doesn't mean all JNLP capable platforms have it.
- We should not assume that because a user can access their web browser that they can (or can just as easily) use Swing. Even though Swing has good Accessibility support, that doesn't mean the user is configured for it or is familiar with it.
User friendly hostnames and automatic service discovery & configuration are definitely things we want. Zeroconf is the way to go (alas Jini, like Java Applets, died due to bad parenting).
This article on jRendezvous in MacDevCenter looks helpful. jRendezvous was implemented by Arthur Van Hoff while at Strangeberry, but the old links there are no longer active. Fortunately Arthur had the good sense to use LGPL as the license.
jRendezvous is now jmDNS (Java Multicast DNS) and it is at SF: http://jmdns.sourceforge.net/
And since Microsoft will obviously continue to ignore open standards in favor of their versions, bridging the gap between Zeroconf and UPnP is something we'll have to do ourselves. A particular motivation is that some routers (such as the Linksys WRT52G) support UPnP. Also Windows and IE presumably can something with it.
The UPnP Forum is the primary reference site.
AntForms & AntMenus is an easy-to-use tool for creating Swing UI for interacting with the user from an Ant Script: http://antforms.sourceforge.net/usageam.html. AntAnywhere currently uses this library.
AntAnt is a precooked Ant build for typical Java projects: http://dehora.net/code/antant/readme.html.
Spring WebFlow has a multiproject Ant build that uses Ivy (which in turn works with Maven & Maven2) called common-build. It is comprehensive with support for demanding Java applications. While the directory layout looks like overkill for very small projects, it has the benefit of not needing to change as project needs change. It doesn't have its own page or documentation but if you download Spring WebFlow source it is in the "common-build" top level directory: . AntAnywhere is transitioning to common-build.
SFUtils is an Ant task for publishing with the SF.net FRS (File Release System): http://sfutils.sourceforge.net/.
Mac OS X BundlesAnt task JarBundler makes Mac OS X Bundles.
- Sparkle makes updating Mac software easier
- Java Web Start on Linux
The Ant Java Web Start Task "ant-jnlp-war" makes creating a JNLP WAR with embedded codebase servlet and Pack200 a simple one-step process: http://ant-jnlp-war.sourceforge.net/. It is currently used in AntAnywhere.
Rachel (http://rachel.sourceforge.net/index.html) is a nifty tool that serves up resources out of Jar files using URLs. That is convenient for code that thinks its resources are files and don't want to mess around with classloader jazz.
- Application delivery via RSS http://connectedflow.com/appcasting/
Douglas A. Lyon and Francisco Castellanos "The Initium RJS Screensaver: Part 4, Automatic Deployment", in Journal of Object Technology, vol. 5. no. 8, November-December 2006, pp. 31-40 http://www.jot.fm/issues/issue_2006_11/column4
Nice job of packaging using Ant and JNLP in Tibet has equally nice documentation.
RelatedWhile AntAnywhere is not limited to Java applications, it is not intended to manage the general *nix package problem. The proliferation of package managers there isn't the answer either, but we will need to leverage them in the meantime (with the help of system virtualization and application bottles) to get the needed ease-of-use on the way to PUP Foundation.
Zero Install SystemA Unix-oriented scheme using feeds for web-based launching ("Unix Web Start"). http://0install.net/
Package ManagersRPM, Apt, Fink, CygWin, ...
Java Native Code
- A GCJ wrapper.
- Annotations for linking to DLLs
Groovy has ActiveX support.