There are resources to help developers who have developed for the obsolete PersonalJava migrate their applications to the new CDC environment. Granted, I don’t believe there are really that many PersonalJava apps lying around, but those who have developed in this area may want to read this interesting article by Eric Giguere.
I’ll highlight below one of the more relevant passages from his work.
|
Applications written to the PersonalJava specification have a J2ME migration path to the Personal Profile (or, in some cases, the Personal Basis Profile). The migration is not seamless, because there are differences between the two Java environments. For an experienced Java programmer, however, the transition is not hard to make, and you end up with an application that uses the more familiar J2SE 1.3 APIs instead of the older (now quite dated) Java 1.1 APIs.
The following packages defined by the PersonalJava 1.2a specification are the same as, or subsets of, the packages of the same name in the Personal Profile:
- java.applet
- java.awt.datatransfer
- java.awt.event
- java.awt.image
- java.io
- java.lang
- java.reflect
- java.net
- java.security
- java.security.cert
- java.security.interfaces
- java.security.spec
- java.text
- java.util
- java.util.jar
- java.util.zip
Note that java.awt is not in this list. PersonalJava includes the PrintGraphics and PrintJob classes from this package, while the Personal Profile does not. With these two exceptions, however, the PersonalJava java.awt package is a subset of the Personal Profile java.awt package.
If your PersonalJava application limits itself to using the packages listed above (including java.awt without the printer classes) it should work unchanged. The only place that you might run into difficulty is with deprecated methods, because the Personal Profile does not include the deprecated methods of Java 1.1.8 other than those in the AWT classes.
The other packages included in PersonalJava are not found in their entirety in the Personal Profile. In particular:
- The design-time classes are missing from the java.beans package.
- PP does not support RMI unless the RMI Optional Package is present. (Note that RMI is optional in PersonalJava.)
- PP does not include any JDBC classes from the java.sql package unless the JDBC Optional Package for CDC/Foundation Profile (JSR 169) is present. (Note that JDBC is optional in PersonalJava.)
- PP does not support the PersonalJava-specific APIs in the com.sun.awt.com, com.sun.lang, and com.sun.util packages. Code that uses these must be rewritten to use the nearest Personal Profile equivalent.
These differences are the reasons that the transition from PersonalJava to the Personal Profile may not be seamless. Some of the changes are quite minor, though. For example, no method in the Personal Profile will throw com.sun.lang.UnsupportedOperationException. Others entail more work, such as replacing use of com.sun.util.PTimer with use of java.util.Timer.
|