java.lang.NoClassDefFoundError: MainWindow$1?

J

jing

hi all.

i'm trying to compile a source package, which is needed for my
graduation design. here is its
url:http://gist.cs.berkeley.edu/libgist-2.0/libgist-2.0.tar.gz,
now, i've almost reached the last step: make amdb with the utility
java. when i tried to run amdb.bat including the java command, the
intepreter gave me the following message:

D:\SpatialDatabase\GiST\tools\libgist\bin>java -classpath
"D:\SpatialDatabase\Gi
ST\tools\libgist_\libgist\src\gui;D:\SpatialDatabase\GiST\tools\libgist_\libgist
\src\analysis;D:\SpatialDatabase\GiST\tools\libgist_\libgist\src\amdbgist;D:\Spa
tialDatabase\GiST\tools\libgist_\libgist\src\treeview;D:\jdk1.1.8\lib\classes.zi
p;D:\Swing-1.1.1\swingall.jar" MainWindow
java.lang.NoClassDefFoundError: MainWindow$1
at MainWindow.<init>(MainWindow.java:47)
at MainWindow.main(Compiled Code)

here MainWindow$1.class was created at the same time of MainWindow.
i don't know what does this error mean. actually, i know little about
java.

any help would be most appreciated.

jing.
 
T

Thomas Fritsch

jing said:
when i tried to run amdb.bat including the java command, the
intepreter gave me the following message:

D:\SpatialDatabase\GiST\tools\libgist\bin>java -classpath
"D:\SpatialDatabase\GiST\tools\libgist_\libgist\src\gui;
D:\SpatialDatabase\GiST\tools\libgist_\libgist\src\analysis;
D:\SpatialDatabase\GiST\tools\libgist_\libgist\src\amdbgist;
D:\SpatialDatabase\GiST\tools\libgist_\libgist\src\treeview;
D:\jdk1.1.8\lib\classes.zip;D:\Swing-1.1.1\swingall.jar" MainWindow
java.lang.NoClassDefFoundError: MainWindow$1
at MainWindow.<init>(MainWindow.java:47)
at MainWindow.main(Compiled Code)

here MainWindow$1.class was created at the same time of MainWindow.
i don't know what does this error mean. actually, i know little about
java.
It means that java tried to get a file "Main$1.class", but didn't find it.
From the error message you also see, that the error occured inside a method
of the MainWindow class. You therefore know, that java *did* find a file
"MainWindow.class", although you don't actually know where.

May be in your "-classpath ..." the directory containing "Main.class" *and*
"Main$1.class" is missing. May also be you copied your file
"MainWindow.class" from one directory into another, but forgot to copy file
"MainWindow$1.class".
 
T

Thomas Fritsch

Thomas said:
jing wrote: [...]
java.lang.NoClassDefFoundError: MainWindow$1
at MainWindow.<init>(MainWindow.java:47)
at MainWindow.main(Compiled Code)
[...]
Arrgh, I meant "MainWindow", not "Main". Sorry for the confusion.
It means that java tried to get a file "Main$1.class", but didn't find it.
... tried to get a file "MainWindow$1.class", but didn't find it.
From the error message you also see, that the error occured inside a
method of the MainWindow class. You therefore know, that java *did* find a
file "MainWindow.class", although you don't actually know where.

May be in your "-classpath ..." the directory containing "Main.class"
... the directory containing "MainWindow.class"
*and* "Main$1.class" is missing. May also be you copied your file
*and* "MainWindow$1.class" is missing.
 
P

pansy4u

Yes, you are right, Thomas. I did copied "MainWindow.class" from one
directory into another, but forgot to copy "Mainwindow$1.class"
together. But even if i copied them all to the target directory, the
*same* error occured again!
I'll check the whole compling procedure.
Thank you, Thomas!

jing.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top