|
There was a pretty fundamental change in how CLASSPATH works -- from JDK 1.1.x to JDK 1.2 (a/k/a "Java 2") -- in that the "system" portions of the CLASSPATH were moved into their own special location. This is a really Great Thing, actually, in that the CLASSPATH can become what was intended -- a "user" CLASSPATH. It is still possible to muck with the boot classpath, using the -Xbootclasspath option, but it is no less a Bad Idea to do so. The class path entries used by the JDK itself were moved to a separate location -- to see them you can look at the "sun.boot.class.path" property. Here's a modified version of your program that includes this additional output: class ShowMeClasspath { public static void main(String[] args) { System.out.println("VERSION=" + System.getProperty("java.version")); System.out.println("CLASSPATH=" + System.getProperty("java.class.path")); System.out.println("BOOTCLASSPATH=" + System.getProperty("sun.boot.class.path","--NOT SET--")); } } (Note the two-string form of System.getProperty, where the second value ("--NOT SET--") is the "default" to return if the property isn't set for the JVM. This should allow the program to run fine on either JDK1.1.x or JDK1.2+...) On a related note, to get a different JDK version of the javac compiler itself (or other tools such as rmic, javap, etc.) you use the -J flag to pass the "java.version" property to the JVM the tool uses. For instance, to use the JDK1.3 version of the compiler to compile ShowMeClasspath.java, you would use: javac -J-Djava.version=1.3 ShowMeClasspath.java HTH. -blair Blair Wyman -- iSeries JVM -- (507) 253-2891 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ "It is a sobering thought that when Mozart was my age, he had been dead for two years." -- Tom Lehrer |---------+------------------------------> | | "JoDoDu" | | | <jododu@xxxxxxx> | | | Sent by: | | | java400-l-bounces@m| | | idrange.com | | | | | | | | | 10/01/2003 11:16 AM| | | Please respond to | | | Java Programming on| | | and around the | | | iSeries / AS400 | | | | |---------+------------------------------> >-------------------------------------------------------------------------------------------------------------------------------| | | | To: <java400-l@xxxxxxxxxxxx> | | cc: | | Subject: CLASSPATH problems | | | >-------------------------------------------------------------------------------------------------------------------------------| We are still on V4R5. This is the Java part of our installed licensed programs: 5769JC1 *BASE AS/400 Toolbox for Java 5769JV1 *BASE AS/400 Developer Kit for Java 5769JV1 1 Java Developer Kit 1.1.6 5769JV1 2 Java Developer Kit 1.1.7 5769JV1 3 Java Developer Kit 1.2 5769JV1 4 Java Developer Kit 1.1.8 5769JV1 5 Java Developer Kit 1.3 With no systemdefault.properties file anywhere, the default in Qshell shows: java -version java version "1.1.8" compiling and running the ShowMeClasspath java program shows: java ShowMeClasspath CLASSPATH=/QIBM/ProdData/Java400/jdk118/lib/jdkptf118.zip:/QIBM/ProdData/Jav a400/jdk118/lib/classes.zip:/QIBM/ProdData/Java400/ex t/IBMmisc.jar:/QIBM/ProdData/Java400/ext/db2_classes.jar:/QIBM/ProdData/Java 400/ext/jssl.jar:/QIBM/ProdData/Java400/ext/ibmjssl.j ar:/QIBM/ProdData/Java400/jt400ntv.jar:/QIBM/ProdData/Java400/:.:/home/jdunn I have set a *JOB environment variable as: .:/home/jdunn ------------------------------------------------------------------ The problem: When I try using the 1.3 JDK (or the 1.2 JDK), the following happens: java -Djava.version=1.3 ShowMeClasspath CLASSPATH=.:/home/jdunn setting up a systemdefault.properties file in my home directory (/home/jdunn) with: java.version=1.3 I get the following: java -version java version "1.3.0" $ java ShowMeClasspath CLASSPATH=.:/home/jdunn I have seen some posts about V4R5 and the 1.3 JDK, but no resolutions. It seems like the "system" portion of the CLASSPATH doesn't get "loaded" if I try to use any JDK other that 1.1.8. The defective CLASSPATH is a problem when I try to compile a java program using 1.3. I get all sorts of: javac ShowMeClasspath.java ShowMeClasspath.java:2: cannot resolve symbol symbol : class String location: class ShowMeClasspath public static void main(String[] args) ^ that does NOT happen when I use the default 1.1.8 environment. Could someone help me? If someone does have JDK 1.3 working successfully on V4R5, could you compile and run ShowMeClasspath.java and post the output? ShowMeClasspath.java: class ShowMeClasspath { public static void main(String[] args) { System.out.println("CLASSPATH=" +System.getProperty("java.class.path")); } } _______________________________________________ This is the Java Programming on and around the iSeries / AS400 (JAVA400-L) mailing list To post a message email: JAVA400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/java400-l or email: JAVA400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/java400-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.