Forums Register Login

why do I get NoClassDefFoundError????

+Pie Number of slices to send: Send
I am trying to run an java application but facing one major stubling block it does not want to run.
C:\java-coding\ftpbean-my2>java FtpExample
Exception in thread "main" java.lang.NoClassDefFoundError: FtpExample
Why???
Here is all the classes in the directory:
C:\java-coding\ftpbean-my2>dir *.class
Volume in drive C has no label
Volume Serial Number is 1631-1CEC
Directory of C:\java-coding\ftpbean-my2
FTPBEA~1 CLA 17,208 09-18-02 11:40p FtpBean.class
FTPREP~1 CLA 1,355 09-18-02 11:40p FtpReplyResourceBundle.class
FTPEXC~1 CLA 224 09-18-02 11:40p FtpException.class
FTPOBS~1 CLA 149 09-18-02 11:40p FtpObserver.class
FTPLIS~1 CLA 5,644 09-18-02 11:40p FtpListResult.class
SOCKET~1 CLA 275 09-18-02 11:40p SocketOpener$SocketFactory.class
SOCKET~2 CLA 724 09-18-02 11:40p SocketOpener$1.class
SOCKET~3 CLA 739 09-18-02 11:40p SocketOpener$2.class
SOCKET~4 CLA 895 09-18-02 11:40p SocketOpener$3.class
SOCKET~5 CLA 885 09-18-02 11:40p SocketOpener$4.class
SOCKET~6 CLA 701 09-18-02 11:40p SocketOpener$5.class
SOCKET~7 CLA 1,792 09-18-02 11:40p SocketOpener.class
FTPBEA~2 CLA 9,778 09-18-02 11:40p FtpBeanBeanInfo.class
FTPLIS~2 CLA 4,691 09-18-02 11:40p FtpListResultBeanInfo.class
FTPEXA~1 CLA 2,104 09-18-02 11:40p FtpExample.class
15 file(s) 47,164 bytes
0 dir(s) 4,370.62 MB free
+Pie Number of slices to send: Send
This definitely looks like a CLASSPATH problem. Make sure that your class directory is in your CLASSPATH env variable
+Pie Number of slices to send: Send
>Blake Minghelli
Yes it seems to be classpath problem
but I am not sure why?
I tried the program at another computer and the program worked there without changing a single line of code.
My autoexac.bat file is where I declare the classpath but it seems to be prettty much identical as the other PC apart from small differences like path.
Here is the path and classpath setting, can anyone spot anything I have missed?

PATH C:\WINDOWS;C:\WINDOWS\COMMAND;C:\j2sdk1.4.0_01\BIN;C:\WINDOWS\jwsdp-1_0_01\bin;
SET CLASSPATH=.;
SET CLASSPATH=C:\WINDOWS;C:\WINDOWS\COMMAND;
SET CLASSPATH=C:\j2sdk1.4.0_01\BIN;C:\My_DL_Dap\java-ftp-dl\build; C:\My_DL_Dap\java-ftp-dl\build\ftp.jar;$CLASSPATH
+Pie Number of slices to send: Send
Every time you do a SET CLASSPATH=BLAHBLAH
you are replacing the previous BLAHBLAH with the
new BLAHBLAH.
So to fix it put ;%CLASSPATH% at the end of each
line:
SET CLASSPATH=.;%CLASSPATH%
SET CLASSPATH=BLAHBLAH;%CLASSPATH%
and so on.
In that way you will accumulate all the classpath elements into one gigantic enormous CLASSPATH.
-Barry
+Pie Number of slices to send: Send
How do I put comments in the autoexec.bat file?
+Pie Number of slices to send: Send
A bit of a side track, but it's
REM And now for something completely BASIC
+Pie Number of slices to send: Send
Barry
Why do you keep quoting from Sun?
I am stymied.
My development of software is never for malicious concern.
+Pie Number of slices to send: Send
Well, I just got some work for a nuclear power station, they wanna program for pulling rods in and out and stuff like that.
Paddy spent all of his days in the O'Furniture back yard with this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1194 times.
Similar Threads
Gives me error when included in the same folder but works when outside folder
why can't see the output in dos window after using buffered reader..??
Is my packaging correct?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 05:21:48.