• 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
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

PATH Vs. CLASSPATH settings

 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How is Path differnt from classpath settings...
do they conflict in any way?
i am trying to run a java program which tries to load jdbc driver
my path is set to: PATH=h:\jdk1.3.1_01\bin
and classpath to:
set CLASSPATH=K:\oracle\ora90\jdbc\lib\classes12.zip;K:\oracle\ora90\jdbc\lib\nls_charset11.zip
if i am right assuming that my dreiver are in : classes12.zip
note oracle is in K: drive and my jdk in H: drive
when i do not set the classpath and run a simple program which outputs a srting it runs alright...BUT... when i set the classpath var my program does not run, tough it compiles fine...
it gives following error on running:
Exception in thread "main" java.lang.NoClassDefFoundError:simpleprogram
but if i do not set the classpath ... simple porgrams run fine but the jdbc programs give couple of other errors.... saying no such pacages exist...like oracle.jdbc.driver.*
I am very confused!
please help !!
[ March 13, 2002: Message edited by: Richa Jeetah ]
 
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This might be of some help: http://www.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=33&t=004858
BTW, classes12.zip is also one of the files I needed in my classpath so my batch files specify this:
set CLASSPATH=%CLASSPATH%;.\lib\classes12.zip
set CLASSPATH=%CLASSPATH%;.\lib\log4j-1.2beta4.jar
Of course just change the path to your zips and jars.
---
Path is where you can specify a directory containing executables (exe, com, bat, etc) and not have to put the full path to them on the command line. It's kind of like the import in Java. If you import a package, you can simply reference a class within the package as opposed to the fully qualified class name. Likewise, if you specifiy a Path to javac.exe you can simply type:
C:\>javac blah.java instead of
c:\jdk1.4\bin\javac blah.java
[ March 13, 2002: Message edited by: David Duran ]
 
Men call me Jim. Women look past me to this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic