| Author |
ClassNotFoundException after setting env variable
|
Pat Peg
Ranch Hand
Joined: Feb 04, 2005
Posts: 188
|
|
Hey all,
I was trying to execute a little bit of code
but it fails right there at the Class.forName. I read that I needed to set the CLASSPATH so I did, both for the system and for me the user...
classpath = .;C:\Program Files\Java\jre1.6.0_07\lib\ext\QTJava.zip;C:\Program Files\Java\jre6\lib\ext\QTJava.zip;C:\jars\classes12.jar
but I am still getting this exception. What else should I do?
|
 |
Pat Peg
Ranch Hand
Joined: Feb 04, 2005
Posts: 188
|
|
So I ran this from the command line
java oracle.jbdc.driver.OracleDriver
and I got the classNotFoundException again so I am guessing that I don't have the variable set correctly but it appears to be. What else could I do. I am a windows machine and set the variable by going to properties of my computer and editing the classpath variable.
I have restarted (a couple of times)...
|
 |
Christophe Verré
Sheriff
Joined: Nov 24, 2005
Posts: 14685
|
|
|
At the command prompt, type "SET". A bunch of environment variables will be shown. Please tell us what the CLASSPATH is there.
|
[My Blog]
All roads lead to JavaRanch
|
 |
Pat Peg
Ranch Hand
Joined: Feb 04, 2005
Posts: 188
|
|
|
CLASSPATH=.;C:\jars\classes12.jar;C:\Program Files\Java\jre1.6.0_07\lib\ext\QTJava.zip;C:\Program Files\Java\jre6\lib\ext\QTJava.zip
|
 |
Christophe Verré
Sheriff
Joined: Nov 24, 2005
Posts: 14685
|
|
You have classes12.jar in C:\jars, right ?
I was trying to execute a little bit of code
How did you execute it ?
|
 |
Pat Peg
Ranch Hand
Joined: Feb 04, 2005
Posts: 188
|
|
classes12 in the jar file? Yes. It is about 1500kb in size and is there.
Tried running it from jdeveloper-I haven't used jdeveloper in years so it could be that there is something to set up that I don't know about. I am trying to research that now.
|
 |
Christophe Verré
Sheriff
Joined: Nov 24, 2005
Posts: 14685
|
|
Pat Peg wrote:Tried running it from jdeveloper
Now that's a different problem. JDeveloper is probably not using your environment variable. I think you have to configure the libraries used by your program in JDeveloper. Something like this ?
|
 |
Pat Peg
Ranch Hand
Joined: Feb 04, 2005
Posts: 188
|
|
|
Cool-thank you. I am reading it now.
|
 |
 |
|
|
subject: ClassNotFoundException after setting env variable
|
|
|