p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Professional Hibernate (http://p2p.wrox.com/forumdisplay.php?f=148)
-   -   CLASSPATH WOES! (http://p2p.wrox.com/showthread.php?t=27395)

arthur.orange March 28th, 2005 08:47 PM

CLASSPATH WOES!
 
Why in this day and age do I have to suffer this?

CLASSPATH WOES (separate post) :

C:\Java\Swing\standalone>echo %CLASSPATH%
C:\Sun\AppServer\lib\j2ee.jar;C:\jakarta-struts-1.2.4\lib\struts.jar;%HIBERNATE_
HOME%\hibernate2.jar;C:\SQLServerJDBC\lib\msbase.j ar;C:\SQLServerJDBC\lib\msutil
.jar;C:\SQLServerJDBC\lib\mssqlserver.jar;C:\j2sdk 1.4.2_06\bin;C:\Hibernate\hibe
rnate2.jar;C:\Hibernate\lib\dom4j-1.4.jar;C:\Hibernate\lib\commons-logging-1.0.4
.jar;C:\Hibernate\lib\commons-collections-2.1.1.jar;C:\Hibernate\lib\ehcache-0.9
.jar;C:\Hibernate\lib\cglib-full-2.0.2.jar

As you can see all imaginable jars are in this classpath and I can view it right there in my command line when I echo the classpath.

and yet when I do the following :

C:\Java\Swing\standalone>java CDTest
Exception in thread "main" java.lang.NoClassDefFoundError: CDTest

That is the error I get!


Until I have to use the following command line "command":

C:\Java\Swing\standalone>java -classpath .;C:\Hibernate\hibernate2.jar;C:\Hibern
ate\lib\dom4j-1.4.jar;C:\Hibernate\lib\commons-logging-1.0.4.jar;C:\Hibernate\li
b\commons-collections-2.1.1.jar;C:\SQLServerJDBC\lib\msbase.jar;C:\SQLSe rverJDBC
\lib\mssqlserver.jar;C:\SQLServerJDBC\lib\msutil.j ar;C:\Hibernate\lib\ehcache-0.
9.jar;C:\Hibernate\lib\cglib-full-2.0.2.jar CDTest

And it works then.

I have to include the path in the command line, why is that?






All times are GMT -4. The time now is 03:58 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.