Re: classpath



Frances wrote:
with Tomcat I have no problems using third-party API's, I just put them in Tomcat/common/lib and include them in the classpath when compiling..

but with a stand-alone I can't get it to work.. I put the two packages in jre/lib and have put command for compiling in a batch file, thus:

javac -classpath c:\j2sdk1.4.2_11\jre\lib\jfreechart-1.0.1.jar;c:\j2sdk1.4.2_11\jre\lib\jcommon-1.0.0.jar;. %1 %2 %3 %4 %5

then to compile I do '<runBatch> myFile.java'

but still java can't find the packages... I don't understand what I'm doing wrong.. I AM importing right packages.. am trying to compile src file I copied verbatim from here:
http://tools.devchannel.org/devtoolschannel/04/03/12/1634222.shtml

would appreciate any help.. thank you..

Frances

same thing w/trying to connect to db; copied mysql-connector-java-3.1.6-bin.jar from Tomcat/common/lib to jre/lib and put it in the classpath at compile time, thus:

javac -classpath c:\j2sdk1.4.2_11\jre\lib\mysql-connector-java-3.1.6-bin.jar;. conn.java

compiles fine but at runtime get ClassNotFoundException: com.mysql.jdbc.Driver

isn't com.mysql.jdbc.Driver inside the connector jar I put in the classpath?

WHAT'S MY CLASSPATH PROBLEM...:( pls help.. thank you very much..

Frances

.



Relevant Pages

  • Re: Confused about how packages work.
    ... The practical solution to your problem is to say: ... and be done with it let Javac sort it out. ... It is tricky figuring out when Javac will compile or recompile classes ... compile the library packages first then client packages, ...
    (comp.lang.java.help)
  • Re: compile SWT program using j2sdk1.5
    ... i am trying to compile the swt program on windows using jdk1.5. ... The journey 'I' is ... anytime smart case, ... What 'Classpath' variable? ...
    (comp.lang.java.programmer)
  • Re: Converting Java batch file from windows to unix format
    ... > Java attempts to compile the source, but it doesnt include the jar ... > files in the classpath. ... javac -classpath $CLASSPATH antigen/builders/*.java ... ...
    (comp.unix.shell)
  • Re: cant find a class...
    ... Add the library to the classpath when compiling with ANT. ... ANT is a build tool, somewhat like "make" is for C. ... Compile the application; ... The API packaged with the JRE/SDK. ...
    (comp.lang.java.help)
  • [Eclipse 3.3 + Ant 1.7] Classpath length on Windows XP
    ... I'm using Ant from within Eclipse to build a project on developer ... and accordingly define two targets "compile" ... classpath argument of the task. ...
    (comp.lang.java.softwaretools)