How can I Deal with this 2 errors?
I'm so desperated I can't even run the HelloWorldApp, because it has this error in the interpreter (I compiled it and Zero erros):
Exception in thread "main" java.lang.NoClassDefFoundErros
and in other program I have this
Exception in thread "main" java.lang.NoSuchMethodError: detail.number () at Factorial.main
But I DO have a method named number which has been inclosed in the object detail.
Please Help Me! I'm really Frustrated (hey, you may be like me if HelloWorldApp doesn't evev runs!!!)
IvanEm.,
My guess would be a CLASSPATH error, probably the most frustrating Java error when you're getting started. Make sure the classpath includes the class you're trying to run.
Hope that helps!
Dave
p.s. I'm openly trolling for Duke Dollars, so if you found this of any help, please toss me a few!
> I'm so desperated I can't even run the HelloWorldApp,
> because it has this error in the interpreter (I
> compiled it and Zero erros):
> Exception in thread "main"
> java.lang.NoClassDefFoundErros
You did compile your file using "javac" correct?
And you are not using "package" in your source code correct?
Once compiled you need to be in the directory where the class file is.
> and in other program I have this
> Exception in thread "main"
> java.lang.NoSuchMethodError: detail.number () at
> Factorial.main
> But I DO have a method named number which has been
> inclosed in the object detail.
No you do not. What that error says is that at that particular point it can not find a method that matches the way you are using the method.
That could be because the method doesn't exist. Or because the signature is wrong. Or because it is private and it needs to be public. Or because it is not part of "detail" but is part of something else.