Java 2 SDK for Solaris Developer's Guide

Tool Incompatibilities

  1. In Java 2 SDK for Solaris, the javac -O option has a different meaning, and might have different performance effects on generated code than it does in JDK 1.1. javac -O directs the compiler to generate faster code. It no longer inlines methods across classes, or implicitly turns -depend on or -g off. Because it no longer implicitly turns on -depend, you need to add -depend to the command line where desired.

  2. Use only versions of javac released after JDK 1.1.4 to compile against Java 2 SDK for Solaris class files. JDK 1.1 versions of javac sometimes generate incorrect inner class attributes (the Java 2 SDK for Solaris javac generates correct attributes). The JDK 1.1.4 javac compiler and earlier compilers could crash when encountering the correct form. Beginning with JDK 1.1.5, javac handles both the old and the new corrected attributes. This is only a compile-time problem. Java 2 SDK for Solaris compiler generates class files that work on older VMs.

  3. Java 2 SDK for Solaris replaces the javakey tool with the keytool, PolicyTool, and jarsigner tools. See the Java 2 SDK for Solaris security documentation at http://java.sun.com/products/jdk/1.2/docs/guide/security/index.html for descriptions of the new tools.

  4. In JDK 1.1, javap -verify performed a partial verification of the class file. Java 2 SDK for Solaris does not include this option. The option was misleading because it did not perform many portions of a full verification.

  5. Prior to JDK 1.1.4, the Java interpreter allowed the class file at /a/b/c.class to be invoked from within the /a/b directory by the command java c (even if the class c was in package a.b.*). In JDK 1.1.4 and Java 2 SDK for Solaris, you must specify the fully qualified class name. For example, to invoke the class a.b.c at a/b/c.class, you could issue the command java a.b.c from the parent directory of directory /a.

  6. Because of bugs in JDK 1.1-based releases, code signed using the JDK 1.1 javakey tool appears to be unsigned to the Java 2 SDK for Solaris. Code signed using Java 2 SDK for Solaris appears to be unsigned to JDK 1.1-based releases.

  7. Prior to Java 2 SDK for Solaris, javac permitted some inconsistent or redundant combinations of command line options. For example, you could specify -classpath multiple times with only the last usage taking effect. You can no longer use this behavior.

  8. Prior to Java 2 SDK for Solaris, the -classpath option of the Java interpreter set the search path used by the VM when loading system classes. The VM then set the java.class.path property to reflect this path. Typically, application classes were invoked directly from the system class path without an associated class loader.

    Java 2 SDK for Solaris now starts applications in an application class loader to take advantage of both installed extensions and the new security model. The -classpath option now sets the classpath used by the application class loader (for loading classes and resources). Similarly, the java.class.path property now reflects this path. You can still override the system classpath used internally by the VM with a new -Xbootclasspath option. In most cases, you should not have to change the system classpath.

    Most applications should not be affected by this change. However, the java.class.path property no longer include those directories and JAR files used for loading system classes. Read the new sun.boot.class.path property for that information. Applications that install their own security managers might be adversely affected. You have to rewrite these applications for Java 2 SDK for Solaris, but in the meantime, the -Xbootclasspath switch is provided for backward compatibility.

  9. The Java 2 SDK for Solaris javadoc tool produces filenames of the form

    package-<package name>.html

    instead of the previous

    Package-<package name>.html

    for package-level API output. For example, previously the default package-level output for package java.io was in file

    Package-java.io.html

    beginning with Java 2 SDK for Solaris, the filename is

    package-java.io.html.

  10. The Java 2 SDK for Solaris javah is different as NMI is not supported, thus the -nmi flag is no longer provided. For more information, see "javah".