Lovely Error Message
I received this lovely little error message towards the end of my JDK 1.5.0_03 install on my XP Pro at work:

I didn't have any browser running at the time. It turns out that Google Desktop was chewing on some freshly installed files that the JDK install process was trying to then patch. At least that's what I think is happening (and I might be wrong.)
Telling Google Desktop to "pause indexing" fixed the situation.
Ant 1.6.3 Is Released
Stefan Bodewig: Ant 1.6.3 has been released just an hour ago.
This really is more or less a pure bugfix release with some nice improvements thrown in, in particular better support for Kaffe and workarounds for some JDK 1.5 oddities. See also here or here.
My bug was fixed. I'm happy!
GCC 4.0.0 Released, Supports Free Software Java
When GNU announced the release of GCC 4.0.0 four days ago, the Java community paid little attention. The prevailing sentiment is "Nah, it's a C++ compiler, whatever!"
And that would be a huge mistake, for GCC 4.0.0 includes a complete Java compiler and an almost complete set of the standard Java libraries. AWT and Swing are progressing rapidly in the GNU Classpath project, which provides the Java class library for GCJ and other JavaVM projects!
When I last wrote about GCJ, the Java compiler in GCC, 844 days ago, the compiler just started to build under the mingw tool chain, and Eclipse made its first run under GCJs Java interpreter, gij after some tweaking of both GCJ and Eclipse.
When I tested out the latest GCC yesterday, paying attention to the Java stack, I was really impressed with the progress the GCJ folks has made in the last two and half years. Almost all of my existing Java sources that compile with Sun JDK 1.4 also compiles with GCJ. AWT based GUI programs (such as those found in Java In a Nutshell, 1st and 2nd edition) runs on my Fedora Core 3, as native programs, using the GTK based peers. Eclipse can now be compiled with GCJ, into a native program on Linux. And it will ship with Fedora Core 4, scheduled for June 4, 2005!
Being part of GCC, GCJ compiled native code can be debugged with gdb, profiled with gprof. Although not yet working, it should be possible to generate coverage information for GCJ compiled application with gcov.
GCJ fulfills the needs for Java in many situations where the Sun JDK does not because of its licensing schemes. While Sun's goal of keeping its Java compatible is a noble one, in practical terms it has produced much forking and alternative implementations:
- Microsoft's DotNET (because the Sun license is not good enough for Microsoft)
- Eclipse and SWT (because the JCP process is not good enough for folks at IBM)
- JBoss (can't claim to be J2EE compatible for a long time)
- GCJ+Classpath (because the Sun license does not allow the JDK to be distributed with Linux distributions)
My prediction is that before long, Java library writers, especially the Open Source and Free Software ones, will care that their library compiles both with the Sun JDK and GCJ.
And a couple of years from now, we may wake up in a world where GCJ dominates in the Free Software realm while proprietary JDKs dominate in Enterprise computing.
Borland Open Sources JBuilder
The Register is reporting that Borland is open sourcing JBuilder:
The Register: Borland Software is releasing code from its core JBuilder integrated development environment (IDE) into the Eclipse open source community after a surprise drop in first-quarter sales.
I don't think there is any reason to use JBuilder any more. It's over priced and under featured. The last time I saw someone using it (and used it briefly in pair programming) was last year, right before Zhicheng switched to Eclipse. Although he's quite good at using it, it is still painful to watch. What could have been accomplished in IDEA with one keystroke takes four or five.
I understand that there are quite a few big companies out there that are still quote-and-quote standardized on JBuilder as their Java IDE. Maybe its time to change?
C++, Boost, Template Meta-Programming, ...
Even though three of us (me, Kevin and Dale) blog now at OCI North, and two more read them, we still practice the ancient ritual of printing out interesting articles on paper (and thanks to Kristin we have a Samsung CLP-510N color laser now) and secretly place them on the little round table where we sit around to have our occasional eXtreme stand-up meetings (gazing into the crystal ball, as Rob puts it.)
Last week, my contribution is one of Ted Newards's blogs, in which he marveled at the state of the C++ programming language:
Ted Neward: What I ran across, of course, was the Boost libraries, which provide a whole slew of free/open-source C++ template libraries, ranging from "function" ("Function object wrappers for deferred calls or callbacks") to "mpl" ("Template metaprogramming framework of compile-time algorithms, sequences and metafunction classes"), to "pool" ("Memory pool management"), to "preprocessor" ("Preprocessor metaprogramming tools including repetition and recursion"). They've even got "lambda", which describes itself as "Define small unnamed function objects at the actual call site, and more". Sounds kinda like closures....
...
Gotta admit, maybe it's time to go back and explore my programming roots; some of this stuff sounds pretty interesting and, better yet, pretty powerful. Maybe I was too quick to jump to the managed world...
Ten months after coming back to a C++ project from six years of Java, I have to say Ted's remark is very observant and matches my experience very accurately. I was expecting something far worse ten months ago: pointers passed around, memory leaks everywhere, home-grown frameworks for everything, overloaded operators making "a = b;" mean something completely different, objects being cast to unrelated types, etc. None materialized.
I think there are several reasons for this. Major among them is the Boost libraries. The boost::shared_ptr class template brought sanity to memory management. We are also using boost::lexical_cast for value conversions, and boost::bind for functional style programming using the Standard Template Library.
Another reason has to do with people. The native C++ programmers on the project are very knowledgeable about the language, the tools, and the design philosophy of C++. Kevin, for example, keeps a copy of the C++ Standard open all the time and can answer any C++ language questions in an instant. C++ hasn't been a language that people flocked to for the past ten years. People who are here secretly loves the complexity and their mind were kept very sharp because of it, which is a good thing.
Yet one more reason for the seeming effortlessness of the project is the use of modern C++ features and design techniques. The fact that the project is a "new" project and the architect and designers have freer hands made this different from other "legacy" C++ projects where developers have to use older techniques to make older compilers and libraries happy.
Just like there are people who left C++ for Java and kept a mental image of the circa 1996 C++ with them, there are people who tried and rejected Java for something else yet kept a mental image of the circa 1999 Java with them. (Therefore all the "Java is only good at Applets", "Swing is too slow", talks.)
Now that I have some experience of going back to an older language, I'd advise others to not cling on the the old image of the languages you left and make an effort to find the improvements made since you left. You'd be surprised.
I think I can also tie this up with two of the advices from the Pragmatic Programmers. One of the advice is to keep your mind sharp (full brainer.) And challenging yourself is always a good thing. Another of the advice is to learn new languages. Of course nowadays they recommend Ruby as the language to learn. But you can learn a whole lot about design and programming paradigms by learning C++ anew.
Firefox 1.0.3 Released, Still Trying To Steal My Home Page!
Just updated to the newly released Firefox 1.0.3.
It is still trying to steal my home pages:

Eric Burke: "Hibernate In 60 Minutes"
Eric Burke gave his Hibernate In 60 Munites presentation at the St. Louis Java User's Group tonight.
Several in the audience have already developed and deployed Hibernate based applications into production. A lot more are considering adopting Hibernate for their future work, replacing home-grown frameworks or object databases.
This is the third time I heard Eric do this presentation. This time he also mentioned the important role the Spring Framework plays in his Hibernate application.
The slides and code handouts can be found here.
The Bitter End of ValueNet
My DSL service, which I bought from a local ISP called ValueNet.net, was cut in the Morning of April 6.
I am aware of ValueNet's problems for quite some time. And this seems to be the bitter end.
I've taken Mike's advice and signed up with SpeakEasy. Service should start within seven to ten days.
LimeWire: The Killer Java Desktop App?
I read Hans Muller's Blog last week talking about LimeWire as the killer Java GUI application. Then I saw Tim Bray trying it out:
Tim Bray: So I checked out LimeWire and... suddenly it was 2000 and I was sitting in my basement, a small part of the great Napster feeding frenzy.
That sounded very tempting. So I decided to give it a swirl. First off, I checked if LimeWire is part of JPackage. It is. But the version in JPackage is old and does not work. So I removed the RPM and downloaded the latest RPM. It has a dependency on Sun's JRE which I don't have. So I downloaded the generic tarball version of LimeWire.
The first problem I encountered is with the runLime.sh script, which contains the following snippet:
${JAVA_PROGRAM_DIR}java -Dorg.apache.commons.logging.Log=org.apache.commons.log
ging.impl.NoOpLog -Djava.library.path=. -jar LimeWire.jar
This is the lamest shell script I've ever seen in a Java application. This practically means in order to run it, I have to cd to the LimeWire installation directory and do a:
[weiqi@gao] $ ./runLime.sh
That brings me to the second problem. When I start LimeWire for the first time, a nice looking splash screen comes up. The splash screen will stay up until some first time configuration stuff is done. The trouble is, the configuration dialog box is directly behind the splash screen. I have to move the configuration dialog box to the side to complete the questions.
Now up comes the main GUI. It is a slick GUI.
Everything feels natural and generous tooltips are used to reveal the details of list items. I did find some of my favorite songs---Teresa Teng songs (clandestinely) popular in China in the late 70's. The download was fast and the preview button played the songs without problems.
Then I got curious and peeked behind the menus, when I saw the apply skins menu item, I decided that I'm going to try some of the other themes. I switched from the Gtk theme to the classical theme. The LimeWire window went away. The splash screen flashed briefly. And the LimeWire window came back, with the new theme. The ongoing download was not affected. Good.
Then I switched theme again. Window went away. Splash. Window came back.
Again. Window away. Splash. Window back. This time with a huge stacktrace scrolling on the terminal window and the Window blank except for a button. Moving my mouse over the screen brought back some of the widgets but not others.
So is LimeWire a functional application that runs reasonably fast and does what it advertises to do? Yes. Is it the poster child of mass market Java desktop application? No.
Java still don't have a desktop killer application.
Blog Reading Considered Harmful
If you are reading this blog entry because some notification icon just jumped up on the lower right corner of your computer screen and you clicked on it to bring up your blog aggregator, stop reading right now.
A recent study by the Washington University Medical School's psychological team has concluded that blog reading is an addictive behavior. They have observed all the classical symptoms assiciated with addiction in avid blog readers. The effect is the most severe in the 25-45 age group. For one group of study subjects, blog deprevation caused headaches.
Like all addictive behavior, blog reading progresses from the light reading of about 10 blogs to more reading more and more blogs and at a more and more frequent intervals. The most severely affected go for their aggregators once every three and a half munites.
The researchers tried some of the most common treatments for blog reading addiction, and found the traditional method lacking in effectiveness. A famale subject became violent during the cold turkey treatment and smashed the computer monitor. Another subject, who's normally calm and collected, experienced a sudden behavioral change and started doing the Numa Numa dance.
There is hope however, according to the lead researcher. Some of the non-traditional treatments are showing different level of effectiveness:
- Blocking RSS traffice at the firewall level turns out to be an effective treatment of blog reading addiction.
- Voluntary counterdose, where Java blog readers were given links to PHP blogs, Republican blog readers were given Democrat blogs, etc., takes the edge off the withdrawal symptoms.
- Blogshock, where the subject were forced to read 10 to 100 time more blogs then he normally read, is also effective.
The bese medicien is prevention, said the lead researcher. Don't let blog reading take over your life to begin with is the best strategy. Some suggestions for moderation are:
- Create a blog reading routine where you read blogs only at a specified computer, hopefully a home computer.
- Set the feed polling schedule to once a week or less frequent.
- Reading a balanced diet of blogs, for every Java blogs you read, also read a PHP blog. Similarly for Republican/Democrat blogs.
The researchers call for the blog writer community to put their technological or political agendas aside and form bounded pairs of bloggers with opposite views and advertise their opponents feed on their blogs. "This is for the common good of all humanity." proclaimed the lead researcher.