Java

Get Up to Speed with Velocity

Trygve Isaacson is dumping some of his own Java code in favor of Apache Velocity, a terrific open source template publishing engine. In the process, he found a solution to a thorny configuration problem that prevented his Web server from finding templates. I wrote an introduction to Velocity for the December 2002 Linux Magazine. Using its own scripting language, Velocity Template Language, the class library prevents template creators from making the biggest mistake of JavaServer Pages -- mixing ... (read more)IBM has donated Cloudscape, an embedded relational Java database that has been in active development since 1996, to the Apache project, where it will be called Apache Derby.There's a Cloudscape tutorial site on IBM DeveloperWorks and an Apache Incubator site where it can be downloaded. ... (read more)

Java 2 in 24 Hours Panned

Just read an old review by Pan Pantziarka shredding Sams Teach Yourself Java 2 in 24 Hours, my beginner's Java book last revised in 2002.By the end of the book, assuming you haven't been stunned into a coma by the author's humor (yep, it's a US thang), you'll have a very superficial view of Java programming. What you won't have is the knowledge or the insight to produce anything useful.Mommy.This book, which has done well with new-to-Java novices, will occasionally receive a total ass-kicking ... (read more)

Java applet takes forever to run

One of my favorite works of art was executed as a Java applet. I bought Every Icon by John Simon Jr. in May 2000 and have been meaning to put it on my Web site ever since. The display of the work takes several hundred trillion years from start to finish, so I don't feel so bad about taking almost four years to share it on Workbench. ... (read more)

Java 1.5's quirky new static import

David Flanagan has been experimenting with the new static import feature in Java 2 version 1.5, which provides a shorthand way to refer to class variables: import static java.lang.System.out; class SalutonMondo { public static void main(String[] args) { out.println("Saluton Mondo!"); } } That seems simple enough, but as Flanagan demonstrates, the static import keyword does some things you might not expect. ... (read more)

Peer into the future with JXTA

My November 2003 Java Matters column for Linux Magazine is now available online. It covers JXTA, a set of XML protocols for peer-to-peer network programming created as an open source project by Bill Joy and Mike Clary at Sun Microsystems. JXTA's an extremely ambitious project with a steep learning curve. A quote from the column: The formulation of networks on the fly, with or without a central server, through firewalls and with authentication and encryption, atop the Internet and other networks ... (read more)

Native2ascii handles Java's character flaws

Recently, I was struggling in a Java programming project with a huge XML file that was supposed to be in UTF-8 format but contained some non-UTF-8 characters. This prevented it from being parsed by XOM, an open-source XML processing library that militantly rejects non-well-formed XML. One of the things that helped me solve the problem was Kris Wehner's excellent weblog post on dealing with badly encoded character data using Java. His first suggestion is to use native2ascii, one of the ... (read more)

Apache developers start weblog community

A weblog community has been launched for members of the Apache Software Foundation. Planet Apache is organized through syndication, presenting an aggregated view of weblogs published by Apache developers. It currently includes Sam Ruby, James Strachan, Stefano Mazzocchi, and several dozen others. ... (read more)

James Gosling on Moore's law

Java inventor James Gosling is using before/after photographs of himself to illustrate Moore's Law, comparing the PDP-8/I mainframe he used for satellite programming in 1969 to a Java smart-card ID from the present: I find it amazing that the hot machine [of 1969], capable of doing all sorts of interesting things with satellite telelemetry (including making high resolution photographs, which was a neat trick with only 8K!), has less horsepower than the cheap piece of disposable plastic [of ... (read more)

Logging stack traces with Log4J

The Dining.Name Web application uses Log4J, Apache's logging library for Java, to log the behavior of classes that import XML data into a MySQL database. Log4J is a simple class library -- the basics take no more than a half-hour to learn, as I described in a Linux Magazine article in 2002. It supports four levels of logging and external configuration. Right now, I'm building Dining.Name at debug level and getting verbose output. When I'm confident that it works, I'll change it to fatal level ... (read more)