Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ClassNotFoundException after setting env variable

 
Pat Peg
Ranch Hand
Posts: 195
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 195
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
At the command prompt, type "SET". A bunch of environment variables will be shown. Please tell us what the CLASSPATH is there.
 
Pat Peg
Ranch Hand
Posts: 195
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 195
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 195
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cool-thank you. I am reading it now.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic