JavaTM Development Kit
|
JDK Tools |
This is only a compile-time problem. Class files generated by the 1.2 compiler will work on older VMs.
Any hard-coded links in doc comments will be broken by these changes. Doc comments should not contain hard-coded links -- use the {@link} tag instead. For more information, see Javadoc.
C:\jdk1.2 ___________|________________ | | | bin lib jre | | _______|__________ java.exe tools.jar | | javac.exe lib bin javap.exe / \ / \ javah.exe ext rt.jar classic java.exe javadoc.exe / i18n.jar / java.dll iiimp.jar jvm.dll awt.dllThe structure shown is for the Windows JDK software; the directory structure of the reference Solaris JDK software is similarly changed.
Class files formerly contained in the classes.zip archive of the JDK software are now split among three files:
In the Win32 version of the JDK software, the DLL file for the Java virtual machine, jvm.dll, is in the jre\bin\classic directory. The classic directory has also been added to the directory structure in the JDK 1.2 software.
The value of the java.home system property is the jre directory rather than the directory where the JDK software is installed, as previously.
The tools.jar archive is not in the default system classpath used by the JDK tools. This means, for example, that you'll need to put tools.jar on the classpath to compile Javadoc doclets:
As another example, a command likejavac -classpath <path to tools.jar> MyDoclet.java
won't work if the classpath isn't set, as it would have in previous versions of the JDK software. You'll first need to explicitly put tools.jar on the classpath, either by setting the CLASSPATH environment variable or by using the -classpath option:java sun.tools.javac.Main MyClass.java
The JDK compiler (javac on Solaris, javac.exe on Win32) takes care of this automatically, so there's no need to put tools.jar on the classpath if you invoke the compiler directly:java -classpath <path to tools.jar> sun.tools.javac.Main MyClass.java
This is the recommended way to use the compiler.javac MyClass.java
For further information on these and related topics, see Command Line Changes From 1.1 to 1.2.
If you fall in either of the above categories, you must relink your native libraries before they can used with version 1.2. On Solaris, you will have to replace -ljava in your link command line with -ljvm. On Win32 with the Microsoft VC++ Linker, the change would be from
tolink -dll -out:mylib.dll -libpath:%JAVA_HOME%\lib javai.lib
Note that this change does not affect JNI programmers implementing native methods.link -dll -out:mylib.dll -libpath:%JAVA_HOME%\lib jvm.lib
We strongly encourage you to migrate your native methods to JNI. JNI is the standard way for making your native libraries interoperate with the Java programming language, and JNI offers virtual machine independence for any native code that you might write. In the future, we will not support the old NMI.
Copyright © 1995-98
Sun Microsystems, Inc.
All Rights Reserved.
Feedback |
Java Software |