aspose file tools*
The moose likes Beginning Java and the fly likes j2sdk-1_4_0_01- windows-i586.exe = java version 1.3 and classpath question??? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "j2sdk-1_4_0_01- windows-i586.exe = java version 1.3 and classpath question???" Watch "j2sdk-1_4_0_01- windows-i586.exe = java version 1.3 and classpath question???" New topic
Author

j2sdk-1_4_0_01- windows-i586.exe = java version 1.3 and classpath question???

Janet Wilson
Ranch Hand

Joined: Jul 16, 2002
Posts: 98
Re: the java version...
This one has me really perplexed. I was trying to utilize the Currency class in the java.util.* package and someone informed me that I needed to be running 1.4. I would have thought that the download of the file with this name: j2sdk-1_4_0_01-windows-i586.exe would have given me the 1.4 version.
When I use the java -version command I get this message:
java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)
I don't get it! Can someone help illuminate this dim bulb? Thanks!
======
Re: the classpath
I am using win2000. Taken verbatim from Sun's Java Development Kit Installation Notes is this text:
CLASSPATH Environment Variable - If you follow the default installation, you do not need to set CLASSPATH, because the compiler and other tools automatically find the Java platform classes. (This has actually been true in all versions of JDK 1.1, but was undocumented.) If your CLASSPATH is not set, you can skip this step.
So, what's the deal? Do I need the Classpath or not?
Big thanks to everyone for helping me out!
Janet
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

I am willing to bet that you have 1.3 installed as well. So, in order to clear this up, what you would need to do is a few things.
1. Adjust your path to point to the 1.4/bin directory
2. Remove the 1.3 version from you system
3. Explicitly call java from the correct versions bin folder. For instance:
c:\j2sdk1.4.0_01\bin\java.exe -version
should give you the correct information.


GenRocket - Experts at Building Test Data
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

As far as your classpath question, with 1.3 there was no need in Windows to supply a classpath. I do not believe you have to in 1.4 either.
When you invoke the compiler, it knows where to find the default set of libraries it needs, however, if you ever want to supply your own libraries outside of the default, then you either must specify them in a classpath variable, or use the -classpath option with the compiler.
Someone please correct me if I am wrong.
Bryant Constant
Greenhorn

Joined: Jun 24, 2002
Posts: 10

Following is the CLASSPATH to use:
.;C:\j2sdk1.4.0_01
The dot ( . ) represents the current directory in Windows and Unix. The CLASSPATH ( or any other
PATH ) is a list of directories to look at to resolve which class ( or program ) to use. The directories are separated by semilcolons ( ; ). The list is evaluated from left to right.
You should also add to your path
;C:\j2sdk1.4.0_01
so that the correct java executables are run.
Make sure that NO other java\bin directory appears before the C:\j2sdk1.4.0_01\bin in your path or that will be the one which is executed.
Janet Wilson
Ranch Hand

Joined: Jul 16, 2002
Posts: 98
Gregg,
Re: the java version...
I'm glad you (and others from a different thread) were insistent on the point re: 1.3. There must be some software which has been so kind :roll: to install their java.exe on my machine that when I ran the java -version command w/in my working directory it showed up as 1.3. But, when I took your suggestion and ran the same command from w/in bin I ended up with 1.4. So, motto for this story is...

add the bin directory to the BEGINNING of your PATH statement or environment variable not at the end like I did!
Thanks!
P.S.-Thx for elaborating on when I would need the classpath. That makes sense.
Janet Wilson
Ranch Hand

Joined: Jul 16, 2002
Posts: 98
Bryant,
Sorry I missed your post when I was busy compiling my other post. Actually, what Gregg said was true, I don't need the classpath for this example (I was trying to use the java.util.* package) but having it in there the way you stated did work fine.
On the other hand, when I tried to change my Path with without the ...\bin, I was picking up one of the older java.exe files on my machine. I had to have the \bin part
Thanks so much for responding to my post! Janet
 
 
subject: j2sdk-1_4_0_01- windows-i586.exe = java version 1.3 and classpath question???