Board index » jbuilder » Setting classpath for application

Setting classpath for application


2005-01-17 10:43:29 PM
jbuilder18
Hi,
up til now I've always written applets and set classpath in plugin control panel to allow use of other Jars for e.g. JDBC drivers.
I've now written my first Java application and am trying to set a classpath for it. I've looked at the documentation and it says to run using:-
java -classpath myDriver.jar -jar myApp.jar
This doesn't seem to work, I keep getting errors saying it can't find the driver.
Any ideas of what I'm doing wrong ? I'm running from a DOS prompt on Windows XP using JRE 1.4.2_06.
Thanks
Sue
 
 

Re:Setting classpath for application

Hi,
If you first run the app from within JBuilder, then in the messages pane you
will see the full classpath used by JBuilder. That's how I got mine to
work!
R
 

Re:Setting classpath for application

Hi,
thanks for the response. I couldn't use the classpath from
JBuilder as it meant having JBuilder installed on all machines
where application run. However that and another post that I
found on Google telling me that classpath seems to be ignored
when using -jar option led me to solution which is :-
java -classpath "C:\classdir\myApp.jar;C:\driverdir\driver.jar" myApp.myClass
Sue
 

{smallsort}