Java Technology Home Page
A-Z Index

Java Developer Connection(SM)
Online Training

Downloads, APIs, Documentation
Java Developer Connection
Tutorials, Tech Articles, Training
Online Support
Community Discussion
News & Events from Everywhere
Products from Everywhere
How Java Technology is Used Worldwide
 
Training Index

Writing Advanced Applications
Chapter 7 Continued: Version Issues

[<<BACK] [CONTENTS] [NEXT>>]

This section provides a table that summarizes problems and solutions related to having different versions of the JavaTM platform installed on your system.


Product Deployment
JDK 1.0.2 Uses CLASSPATH to find and load the core system classes.

On Windows 95:
CLASSPATH=/usr/java/lib/classes.zip:.

On Unix:
CLASSPATH=c:\java\lib\classes.zip

Unix Dynamic libraries, .dll files, shared objects, and .so files are located by the PATH variable.

Side Effects:
The Win95 Autoexec.bat file contains an outdated CLASSPATH variable set by a user or the installation of other applications.

The WinNT User Environment contains an old CLASSPATH variable.

The Unix .cshrc, .profile, or .login scripts contains wrong CLASSPATH.

The JAVA_HOME environment variable is also used by programs so check this is not set. You can clear this field in the Bourne shell (sh) as follows: unset JAVA_HOME

Diagnostics:
Use the -classpath option to force the Java VM to use the command-line.CLASSPATH only: java -classpath c:\java\lib\classes.zip;. myapp

Product Deployment
JDK 1.1 Uses relative paths to find the classes.zip file from the Java platform installation. The CLASSPATH environment variable is used to load application classes.

Side Effects:
Other Java releases found on the application path might be picked up if the new JDK bin directory is not explicitly set at the front of the PATH environment variable.

Diagnostics:
Use the -sysclasspath option to force the Java VM to use the CLASSPATH supplied on the command line only: java -sysclasspath c:\java\lib\classes.zip;. myapp

Product Deployment
Java 2 Platform The platform is split into a Java Runtime Environment (JRE) and Java compiler. The JRE is included as a subdirectory in the release, and the traditional java and javac programs in the bin directory invoke the real program in the jre/bin directory. The separate jre launcher is no longer provided, and the java program is solely used instead.

The Java ARchive (JAR) files containing the core Java platform system classes, rt.jar and i18.jar, are located in the jre/lib directory with a relative search path.

Side Effects:
If applications previously used the classes.zip file to load the core Java platform systems, they might still try to load an additional set of classes in error.

Diagnostics:
Use the -Xbootclasspath option to force the Java VM to use the CLASSPATH supplied on the command line only: java -Xbootclasspath:c:\java\jre\lib\rt.jar;
c:\java\jre\lib\i18n.jar;. myapp

You might need to supply this as a runtime option as follows: javac -J-Xbootclasspath:c\java\lib\tools.jar;c:
\java\jre\lib\rt.jar;c:\java\jre\lib\i18n.jar;. myapp.java

Product Deployment
Java Plug-In On Windows 95 and Windows NT uses the registry to find installed plug-in Java platform releases.

Side Effects:
Registry can become corrupted, or plug-in removed physically but not from the registry.

Diagnostics:
Display the java.version and java.class.path property in your code and display it on the Java Plug-in Console

System.out.println("version="+System.getProperty(
  "java.version"
  ));
System.out.println("class path="+System.getProperty(
  "java.class.path"
  ));
If there is a conflict, check the registry with the regedit command, search for the word VM and if it exists, delete it and reinstall the plug-in
Product Deployment
Netscape Uses .jar files such as java40.jar in netscape directory.

Side Effects:
Not all Netscape releases are fully JDK 1.1 compliant. You can get upgrade patches at http://www.netscape.com.

Diagnostics:
Start the browser on the command line with the -classes option.

Product Deployment
Internet
Explorer
Uses .cab files to contain system classes. Also uses system registry on Windows 95/NT.

Side Effects:
Use the regedit command to search for the word VM. There is a CLASSPATH entry to which you can add your own classes.

Diagnostics:
The registry can become corrupted. Search for CLASSPATH using the regedit program and edit the value that CLASSPATH points to.

[TOP]


[ This page was updated: 13-Oct-99 ]

Products & APIs | Developer Connection | Docs & Training | Online Support
Community Discussion | Industry News | Solutions Marketplace | Case Studies
Glossary - Applets - Tutorial - Employment - Business & Licensing - Java Store - Java in the Real World
FAQ | Feedback | Map | A-Z Index
For more information on Java technology
and other software from Sun Microsystems, call:
(800) 786-7638
Outside the U.S. and Canada, dial your country's AT&T Direct Access Number first.
Sun Microsystems, Inc.
Copyright © 1995-99 Sun Microsystems, Inc.
All Rights Reserved. Legal Terms. Privacy Policy.