ADC Home > Reference Library > Technical Q&As > Legacy Documents > Java >

Legacy Documentclose button

Important: This document is part of the Legacy section of the ADC Reference Library. This information should not be used for new development.

Current information on this Reference Library topic can be found here:

Creating serialVersionUIDs using MRJ


Q: Is there a tool to generate the serialVersionUID for a class on the Mac? (serialver is part of the JDK on windows).

A: Yes there is. The classes for it are included as part of the standard MRJ install. To run the SerialVer program you will need to use JBindery (part of the MRJ SDK).

To create a JBound application to run the SerialVer program:

Launch JBindery.

In the Command panel set the class name to:

sun.tools.serialver.SerialVer

set the optional parameters to:

-show

You will need to add the classes you are concerned with to the classpath. This can be done in a couple ways:

  1. Add your jar file or classes to the "MRJClasses" folder (located at StartupDisk:System Folder:Extensions:MRJ Libraries:MRJClasses).
  2. Modify the classpath in JBindery. To do this, you choose the Classpath panel in JBindery and add your classes. See the JBindery documentation for more information on the different ways to accomplish this.

Once you are done configuring the settings in JBindery, save the settings as an application, and use this resulting JBound application to launch the SerialVer program from the Finder.

As an example, I added a manual entry of file:///$APPLICATION/ to my classpath. This adds the folder the JBound application is in to the classpath and is useful because the target classes can be moved into the folder, and then accessed from the SerialVer program.

By adding a manual entry of file:///$APPLICATION/ to the classpath, the Java environment will look in this folder (the application's folder) for classes it needs to load. This requires the classes be ".class" files, and not ".zip" or ".jar "files, and it requires the classes to be placed in a directory structure which represents the package the class belongs to. For instance, if I wanted the application to be able to see my class named Foo which has been defined to be in the levi.random.misc.stuff package then I would arrange my files like this:


arrangement example

[May 17 1999]


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.