• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

ClassNotFoundException after setting env variable

 
Ranch Hand
Posts: 195
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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)...
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Cool-thank you. I am reading it now.
 
Listen. That's my theme music. That's how I know I'm a super hero. That, and this tiny ad told me:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic