Thread: CLASSPATH WOES!
View Single Post
  #1 (permalink)  
Old March 28th, 2005, 08:47 PM
arthur.orange arthur.orange is offline
Registered User
 
Join Date: Mar 2005
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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?




Reply With Quote