Monday, January 14, 2013

Is it time to retire java applets?

As a heavily invested Java programmer, I see dark clouds on the Java horizon. Is seems like Java has entered the center stage for security bloopers on the web these days, and rightly so. Any web-friendly technology that gains the unwanted interest from cyber-criminals, will suffer the consequences of bad press. The last poster child for bad security press was Microsoft, which seems to have learned it's lesson, if we accept the security press and advisers take on it.

Every technology have weak spots, security vulnerabilities are probably the worst to handle. Regardless good intentions and efforts of the industry backing the technology in focus, the only solution is to fix it, or discontinue web-support altogether. Oracle have in my opinion done the Java community a big disservice by doing neither. They continue to prove security advisers right, by really bad press handling and slow and meager progress on patching known security vulnerabilities. Does Oracle believe in Java Applets any more? I don't think so, and I agree with them. According to, Java Applets are only used by 0.1% of the 10K most visited and most well known websites on the web (0.28% for top 1M). Compared with the competition, the similarly outdated technology Flash (7.5% on 10K, 10.9% on 1M), these numbers speaks for them selves. Java Applets are dead, and are dragging the rest of Java community down the drain with it.

I deeply sympathize with all the applet users out there, which are deeply invested in Java Applets, but it is time to let it go. You are killing Java by forcing Oracle to continue supporting an insecure and really outdated technology. There are good alternatives, even Java-based ones, that replace almost all of Java's Applet functionality.

And Oracle, please discontinue Java Applets! Don't kill Java for a meager 0.1% market share!

Tuesday, August 28, 2012

GWT and lightweight mapping with Leaflet

There is a lot of webmapping toolkits out there.  Some are feature rich, other limited to desktop browser, and very few of them are first class citizens of Google Web Toolkit. Current state of mapping support in Google Web Toolkit is, let us just say, not optimal. Support for Google Maps v2 is marked as as deprecated, and support for Google Maps v3 is still in the works, but not adopted into gwt-google-apis yet. To make things worse, the Google Maps terms of service does not allow you to use third-party base maps without a Google Maps base map also being present. Not good news if you want to implement a transparent mapping solution with offline support.

There are other mapping toolkits for GWT, like gwt-openlayers and gwt-esri, but I wanted something more lightweight and more modern, which also supports mobile devices. One project which stood out of the "mapping-jungle" was Leaflet,

... a modern open-source JavaScript library for mobile-friendly interactive maps. It is developed by Vladimir Agafonkin of CloudMade with a team of dedicated contributors. Weighing just about 27 KB of gzipped JS code, it still has all the features most developers ever need for online maps, while providing a smooth, pleasant user experience.

So I went to it, and made gwt-leaflet, a first class citizen mapping toolkit for GWT. It wraps Leaflet using JSNI and Type Overlays, which expose Leaflet API as Java interfaces and classes. It is still early days, and some work remains before all relevant parts of Leaflet API are exposed in GWT. For the technical inclined readers, I have prepared a short summary at github, which goes a bit further in explaining the technical aspects of the project. The nice map below is the example project running as a Google app at

Saturday, July 7, 2012

Script for installing Oracle JVMs on Linux

Java developers sometimes need to change the default java installation. On Linux this is pretty easy with update-java-alternatives. This however, will only work with JVMs which are registered properly, typically by some linux package manager. Since Canonical no longer supply any packages for Oracle JVMs due to licensing issues, and Oracle does not provide any support for registering their JVMs with update-java-alternatives, I was recently "inspired" to make a script for managing Oracle JVMs on Linux platforms. It should work with all distributions which have bash support, but I have only tested on Ubuntu 12.04 LTS.

The script is named update-oracle-jvm and you can download a self-extracting binary from github. Just follow the instructions and you should be able to install Oracle JVMs with update-java-alternatives support from the command-line fast and reliably. This is a screen bump of the command "update-oracle-jvm -h":

I hope this small contribution make life easier for fellow java developers on linux. If you encounter any bugs, please use the issue system at github and I'll do my best to resolve them in a timely manner.

Tuesday, June 12, 2012

Changing Default Gist Styles

Default Gist styles are not that pretty, and the lack of layout and content options is a bit annoying. Thanks to Joe Petterson, an interaction designer and UI developer at Digital Science, a simple solution to this problem is available, called Pretty-Gist. You can read more about it on Joe's website, or just follow the instruction at github.