Tuesday Nov 14, 2006

Open Source Java

A day late I know, but I'd still like to personally thank Jonathan and Rich and Simon and everybody else who were involved in removing the final barriers and allowing Java to be finally released under a real open source license.

eWeek also has a good writeup on what happened yesterday.

When I released my small piece of the Java world under an LGPL licence about two ½ years ago, I had to go around and get sign-off from five VP's (including Jonathan), two CTO's and I forget how many lawyers. At the time I was really worried that our upper management still didn't fully understand open source.

I'm not worried any more.

Another thing that really impressed me with the recent Java announcement is the way that the Sun bloggers were treated. We had the opportunity to attend a briefing conference Sunday afternoon (Pacific time), then, when the press embargo was lifted at 9pm that night, Sun bloggers were given the go-ahead to blog about it, even before the official Sun announcement on the Monday morning.

I know I'm biased, and love this company, but sometimes you just have to put your marketing hat on and say "Way to go Sun!"



Thursday Sep 21, 2006

Sun Releases NetBeans Version for Beginners

As somebody who has tried NetBeans at several different times (typically when a new major release has been announced), looking for a really simple, ease to use IDE, without having to spend a lot of time learning how to drive it (because I don't have that time), this is refreshing news.

I tried BlueJ a couple years ago, and it was just what I had in mind (except that it didn't support the then latest version of Java, which was what I needed for what I was testing).

The merging of these two tools will hopefully provide a perfect transition for me, to the more fully-featured NetBeans environment.

For more information on the NetBeans 5.0 IDE BlueJ edition, checkout their website.





Tuesday May 16, 2006

JDK Distros Project

The eleventh JavaOne has started and there's big news. There's a new DLJ license for Java. With this change some of the Linux distros are going to automatically include Java SE 5 JDK, including Ubuntu, my favorite Linux distribution.

Yippee! One less thing I'll have to install afterwards.



Saturday May 21, 2005

Adding Java.net Posts to this Blog

Now that roller is allowing us to display greater than 100 entries, and because there is also now a simple way to "back up" this blog, I'm going to copy over the very first blogs I did on java.net to this blog, adjusting them to my current style.

I'll leave links to the original posts, so you can see the comments they generated.


Friday May 06, 2005

Java Accessibility Helper v0.8

You will probably have seen that a variety of Sun web sites (for example, Sun.Com, Java.Sun.COM and our Sun blogs got a new look and brand this week.

One of the side effects of this was that any software that was waiting for release was put on hold until everyone was sure that the old functionality of the sites with the new look and feel all worked nicely together. That hold has now been lifted, and yesterday a new early-access version of the Java Accessibility Helper that I've been working on, made it out the door.

There's not a lot of new functionality in this version. We were mainly going for ease of use and for a larger audience by supporting more platforms. The following changes have been made in v0.8:

  • You no longer have to be logged in as root to install on Unix-like systems:
    One of the biggest complaints of the previous versions of the Helper was that you needed to have super-user privileges in order to install the software on Solaris. Of course the RBAC functionality built into recent versions of Solaris alleviates this problem somewhat, but after a little bit more research, and using a couple of fairly new features added to the Java platform, it was discovered that we could adjust the way the Helper worked, so that a normal user could do the installation. Those two Java features were:
    • -Djava.ext.dir=<alternate ext dir>:
      The Helper requires a jaccesshelper.jar that previously was put in the .../jre/lib/ext directory under the user's JRE/JDK directory. These files were typically owned by root. Using the -Djava.ext.dir=<alternate ext dir> command line option to the java command, we are now able to specify an alternative ext directory (which contains the jaccesshelper.jar file) that is owned by the user.
      The -Djava.ext.dir option solved the problem of being able to test any Java application or applet started by the Helper, but one of its really nice features is that you can test a Java application just started up by a script (NetBeans for example). In order to pass in that alternate ext directory to any executable script started by the Helper, we now set:


      in the script that starts the Helper. This option passes any Java options set here to any Java applications started by the script. So the script passes it to the Helper, which in turn passes it to the script starting a Java application to be tested.

    With these changes, the installation also becomes much simpler and this has reduced the size of the graphical installer by about 1/2 Mb.

  • Two new wrapper scripts used to start the helper:
    After using FindBugs, I noticed that it had a couple of really nice scripts for starting up the application:
    • findbugs.bat for Windows and
    • findbugs for Unix-like systems.

    These scripts were adapted from scripts found at http://www.ericphelps.com/batch/, so I was about to take those two scripts, rename them, adjust them a little bit, and use them with the Helper, providing a much nicer way of starting it.

  • All the Helper files are now available in a downloadable zip file:
    The Helper uses a graphical installer that happily supports Windows, Solaris and Linux (even HP-UX), but doesn't support platforms like Mac OS X. As the Helper works just fine on Mac OS X, and that with this version there really is no special tasks that the installer does (it just unpacks a load of files in a directory), we've made an alternate download available. This is just a zip file of all the Helper files which you'd need to unzip wherever you want to install them.
  • Support for testing applications that don't implement getAccessibleParent properly:
    Previous versions of the Helper used the Java methods getAccessibleParent, getAccessibleChildrenCount and getAccessibleChild(i) to traverse the widget hierarchy of the Java application being tested. It was found that some applications that created their own custom components (NetBeans 4.0 for example), didn't correctly implement getAccessibleParent, causing the Helper to hang when it was testing them.

    This problem was circumvented in Helper v0.8 by just using the getParentOf and getChildrenOf methods instead.

With all these changes, we hope that the Helper will reach a larger audience and allow them to test more Java applications for accessibility related problems.


Thursday Mar 24, 2005


In a recent internal email James Gosling mentioned a cool Java software project called FindBugs written by Bill Pugh of the University of Maryland. FindBugs is a program which looks for bugs in Java code. Yesterday I downloaded it and tried it out on the Java Accessibility Helper, a Java application that I maintain.

Installing it basically consisted of unpacking the compressed tarball. When I ran it on the Helper I initially got the following summary:

        Summary Analysis Generated at:
        Wed, 23 Mar 2005 10:43:00 -0800

  Type Checked    Count    Bugs    Percentage
  Outer Classes   129      313     242.64%
  Inner Classes   256       63     24.61%
  Interfaces       35        0     0.00%
  Total           420      370     88.10%

  12 Packages Analyzed

Ouch! In going through the bugs found, I'm confused on exactly how it gets this number. I went and fixed up 82 different problems that it found, and then by adding up the total left in the "By Bug Type" category, I reckon there are 77 left. So that's a total of 159. I then clicked on Settings->Configure Detectors and checked all the bug types and it only found four more bugs. I need to investigate this further to find out what's going on here.

I then got curious on whether the number of bugs reported against the Helper was typical. I decided to try it on the latest version of FreeTTS, a freely available text-to-speech synthesizer, which is written by three guys who I have a great deal of respect for. Here's the results:

        Summary Analysis Generated at: 
        Thu, 24 Mar 2005 08:40:31 -0800

  Type Checked   Count   Bugs   Percentage
  Outer Classes  160     154    96.25%
  Inner Classes   69       9    13.04%
  Interfaces      48       0     0.00%
  Total          277     162    58.48%

  19 Packages Analyzed

Ah, I feel a bit better now. Even though I'm not the original author of the Helper code, I had been through it and fixed up several thing prior to the FindBugs testing. It was a little disconcerting to see FindBugs reporting so many problems, but it appears that it's good at finding bugs that the Java programmers might not know about.

To summarise, FindBugs is a great piece of software. I encourage you to run it over your Java code and see what it reports.


Wednesday Jan 26, 2005

Java Pet Peeve

I'm guessing there's got to be a very good reason for this, but I can't see it. Perhaps somebody can enlighten me. I'm thinking of something here that can help novice Java users.

Hand's up all the people who, when they were first starting with Java, accidentally typed something like:

  % java SomeApp.class

when they really should have been trying to run:

  % java SomeApp

You got back an error message like:

Exception in thread "main" java.lang.NoClassDefFoundError: SomeApp/class

Now experienced Java users realise soon realise what's going on here and adjust accordingly. But what about helping novice Java users?

With just a little more effort the java program could check to see if there was a SomeApp.class file in the currently directory and then check if it was a valid class file and if so, it could return an error message like:

Exception in thread "main" java.lang.NoClassDefFoundError: SomeApp/class

Did you really mean "java SomeApp" ?

or something similar. I'd leave it to HCI people, or a flock of senior engineers or lawyers to properly define the wording.

What am I missing?

Update: After receiving some private email on this, I've filed CR #6222504 on this issue. If you are interested get yourself added to that bug's interest list.


Monday Nov 01, 2004

First release of Auto-bookmarking software.

I've just released the first version (0.3) of my auto-bookmarking software. You can download it from here. It is released under the LGPL license.

The files in this distribution are an attempt to automatically generate browser bookmarks from an initial set of topics, by using the Google Java API and extracting the best hit for each query.

For more information on the reasoning behind why this is considered useful, see:


Bookmarks are generated in the XML Bookmark Exchange Language (XBEL) format. For more details on this specification see:


To use the Auto-bookmarks software, you will need to download a copy of the Google developer's kit, create a Google account and obtain a licence key. For more details on this, see:


The distribution contains various files related to generating bookmarks based on the Library of Congress Classification. For more information on LCC, see:


In particular, the file LCC/LCC.txt is a text-based representation of the various LCC PDF files found on the above web site, and will be the input for the auto-bookmark work being done based on LCC data.

The full README for the Auto-bookmarks distribution, including instructions on how to compile and run the software, can be found here.

Suggestions for further improvement would be most welcome, plus bug reports and comments. I'm sure there will be some tweaks to get it initially working for everyone. I'm also interested in working with others to improve this. Even helping with defining the best Google searches to get the most useful top hit for each subject would be great.

You can add comments to this post for discussion, or email at <firstname>.<lastname>@sun.com




Thursday Sep 30, 2004

Announcing JSDT v2.2

I'm pleased to announce the second open-source release of the Shared Data Toolkit for Java Technology. This toolkit implements a multipoint data delivery service for use in support of highly interactive, collaborative applications.

The following changes have been made to JSDT since the v2.1 release:

  • Added in support for a JGroups reliable multicast implementation, and made this the default multicast implementation (the alternative is LRMP).
  • Removed all references to the RMF/RAMP multicast implementation (as this is no longer available for download).
  • Instructions have been updated in the top-level README to describe what needs to be done to setup to build the JGroups and/or LRMP multicast implementations.
  • Adjusted code to build with JDK 1.5.0.
  • Fixed up all the deprecated method warnings in the JSDT toolkit classes (and implementations).
  • Fixed up the two deprecated method warnings in the sound example.
  • Fixed up 5 out of 6 of the deprecated warnings in the ppong example.
  • Adjusted .../socket/SSLSocketFactory.java to use the SSL Socket code in the javax.net.ssl classes.
  • Removed all references to USE_SSL and SSL_CLASSES from the README and the build environment.
  • Updated section 8.2.2. of the User Guide to use the only default cipher available (SSL_RSA_WITH_RC4_128_MD5) and remove the sentence indicating that you need to supply the SSL socket package.
  • Q12 of the JSDT FAQ now covers how to setup SSL socket supprt. See: https://jsdt.dev.java.net/files/documents/1222/4670/JSDT-FAQ.html#Q12
  • Rewrote the browser example to use the Swing toolkit (with the JEditorPane widget doing the HTML rendering) rather than the ICE browser Java bean.
  • Adjusted the top-level README and the build hierarchy to remove all references to the ICE Browser.
  • Browser example titleline now includes "[Teacher]" for the first started version.
  • With the browser example, if a URL is incorrect, a dialog now displays an error message.
  • Changes to decrement the noThreads count of the number of created DataReceivedThreads when a data received thread terminates (after handling the received messages). Done for socket, http and multicast implementations.
  • Removed references to SOUND_CLASSES in the top-level README and the Makefile.defs and Makefile.config files as the Java sound classes are now a standard part of the JRE/JDK.
  • Adjusted the protection level of the various setShutdown methods. They should not be public.
  • Preparation for building irrespective of the build platform. Added preliminary ANT build file.
  • Changed the getManagerId() method in com.sun.media.jsdt.http.ManageableServer to public to make the HTTP protocol version compile again.

There are two ways to get the JSDT 2.2 distribution.

  1. As a single zipped file of the source distribution. See the "Documents & files" link on the left of the project home page. The file you want is jsdt-src-2.2.zip under jsdt/releases.
  2. From the CVS repository. See:
    https://jsdt.dev.java .net/source/browse/jsdt/
    for more details on how to do this.

Anybody interested in JSDT should become a member of java.net (if they are not already one), and then join this project.



Monday Aug 16, 2004

The Java Accessibility Helper

Time to blog about something I'm actually working on. I'm part of the Accessibility Program Office. Part of our charter is to make sure all of our products are accessible to people with disabilities. When it comes to software, our job is made a lot easier by the built-in accessibility support that is provided by Java and the GNOME Desktop.

I wrote a month or so ago that I'd taken over the maintainence of a sizeable Java application and I was starting to try to get my head around it. Well that application is the Java Accessibility Helper which was written by Jeff Dunn when he was at Sun.

As the download page says:

The Java Accessibility Helper aids developers in making their JFC-based programs accessible to users with disabilities. A report is generated that includes a prioritized list of problems and potential problems with the application being tested. For example, the Helper verifies that all input fields in an application can be reached using only the keyboard. The Helper does not require the source code for the application being tested and will work with any AWT- or Swing-based application.

The current version that's available for download is 0.6, and I'm working on the next version. A feature I've just added is to help with testing Java applets. You now provide the URL of the HTML file containing the applet information as opposed to just the path to the applet class file. This means that it will now automatically pick up the jar ARCHIVE file tag, param name/values and any of the other HTML applet tags associated with the applet, functionality that has been missing from previous JAH releases.

There is still a fair bit of work to do to make the Java Accessibility Helper as great as it could be, but as we work up to the initial 1.0 releases, some of that missing functionality will be added in.



Friday Aug 06, 2004

Printing a stack trace.

I find myself needing to print a stack trace at certain points within my Java application (I'm trying to debug a race condition). Now I did most of my Java programming between 1996-99 and I'm now just returning to it, so I'm hoping that there is a simple answer to this and it's common knowledge for the Java cognascenti.

I'm currently using an "old" method I wrote for generating a stack trace:

      public final static void
      printStack() {
          new Exception("Stack trace").printStackTrace();

But that will print the whole stack trace. Every single frame. I'm looking for a variant where I can pass in an argument that specifies the number of frames I'd like printed. It doesn't seem to be a standard part of the language. Certainly not from looking at the JavaDoc for the Throwable class.

I'm guessing somebody has "been there, done that" in the last five years. Can anybody point me at such a beast? Thanks.


Monday Jun 21, 2004

Java, now with builtin lint.

A couple of weeks ago, I got a chance to see Josh Bloch and Neal Rafter do one of the talks they will be giving at JavaOne this year. This was in the Auditorium at the Santa Clara campus, and was for Sun employees who might not get a chance to go to the conference sessions at JavaOne.

The talk described the new features in J2SE 1.5.0 (which is currently available in beta2).

Lots of great stuff, but something that caught my ear was that the "javac" command now has a -Xlint option that provides lint style output of your Java code.

Cool. So I tried this on JSDT, a Java collaboration toolkit that I wrote, just to see what it would pick up on. I always run lint on my C code, so it's nice to automatically have something similar for Java (yes, I know about Java lint but it's not quite the same thing).

Well first javac in J2SE 1.5 wouldn't compile my code because I was using "enum" as a variable name, and it's now a keyword in the language. That was an easy one to fix. After it successfully compiled, it started giving me lint messages. Lots of them. They boiled down to the following three types:

  • warning: [serial] serializable class classname has no definition of serialVersionUID
  • warning: [unchecked] unchecked call to addElement(E) as a member of the raw type java.util.Vector
  • warning: [unchecked] unchecked call to put(K,V) as a member of the raw type java.util.Hashtable

Nothing life threatening, but they should be easy to fixup. Thanks for adding this facility to the compiler.



Tuesday Jun 15, 2004

Adding JGroups support to JSDT

Today I checked back the changes to add a new JGroups reliable multicast support implementation for the Shared Data Toolkit for Java(TM) Technology

It was ridiculously easy. JSDT is so designed that each new multicast implementation needs to implement the com.sun.media.jsdt.multicast.Multicast interface which defines five methods. Here's what the new code looks like.

Since 1997, JSDT has has the ability to dynamically load the transport protocol (a special Java class) to use. I even have a patent for it.

Because of this approach, combined with great JGroups API documentation and demo examples and the willingness of the JGroups author Bela Ban to help answer a couple questions I had, this was a trivial job.







« July 2016