JavaScript as a Mirror of Our “Real” Languages

Yesterday I went to this year’s Atlanta Code Camp, which I had learned about through the Atlanta JavaScript Meetup mailing list. Code Camp is a very Microsoft-centric developer symposium, whereas my bread and butter lie firmly in the Java world. However, the event offered several interesting sessions on “single-page application” (SPA) JavaScript frameworks, and cost only $5 for the full day including lunch. Sold! The speakers in the SPA sessions gave an interesting amount of attention to a framework called Durandal, an AngularJS competitor built on top of Knockout and RequireJS. [Read More]

WAR files vs. Java apps with embedded servers

Most server-side Java applications (e.g. web or service-oriented) are intended to run within a container. The traditional way to package these apps for distribution is to bundle them as a WAR file. This is nothing more than a ZIP archive with a standard directory layout, containing all of libraries and application-level dependencies needed at runtime. This format is mostly interoperable, and can be deployed to whichever server container you like, Tomcat or Jetty, JBoss or GlassFish, etc. [Read More]

How to install Oracle’s Java on Ubuntu the easy way

Developers on Ubuntu are accustomed to seeing at least two flavors of Java. OpenJDK is an open-source build of the Java runtime and compiler. The Oracle JDK is built upon this, but adds some closed-source components. In theory, OpenJDK is the official reference implementation of Java 7, and should be perfectly fine for all your needs. In practice, it is still known for having issues with common app servers and frameworks. [Read More]

INI files for easy multi-environment config in Java

Almost all applications need to run in multiple environments. If nothing else, they are tested on a developer’s workstation before deployment to a production box. There can be QA and UAT environments in between, and there might even be more than one production target. At runtime, applications usually need environment-specific info such as which database to use, credentials, etc. Large-scale apps normally manage this with a dependency-injection framework like Spring. The typical “cloud” host approach is to use environment variables. [Read More]

Injecting JavaScript into Ant builds

Background Recently I’ve been working on an implementation of hybris, a Java e-commerce package whose build system is based on Ant. The Maven Ant Tasks plugin is available for importing dependencies, but I wasn’t happy with the default tasks that wrap this plugin. They make no attempt to purge old dependencies that have been removed from the POM. The build script keeps your Eclipse projects up to date with most changes, but does not update classpath settings when dependencies change. [Read More]