I am just starting to use firebase in a Java program (not Android) and so far, everything was fine (I could login, create user, add data, retrieve data and delete data from firebase). But, all of a sudden, I keep getting the following error:
Caused by: java.lang.ClassNotFoundException: com.firebase.client.Firebase$AuthResultHandler
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source) ... 20 more
The part that is getting this error is:
I am really stumped as to what to do because I didn't have this error previously and one night once I close my pc and restart, this error keeps coming up.
When you say you are using Firebase, that must mean that you got some code from somewhere and put it into your classpath. And when you did that, somehow that inner class didn't get included in the process. So could you describe how you got the code and how you copied it to your system?
yes. I right click on the jar file to add it into the build path.
On viewing the contents of the jar file, the class "com.firebase.client.Firebase$AuthResultHandler" is present.
Thus, I am not sure as to where would the sub class would be added into the build path?
Thanks for reporting the cross-post on Stack Overflow, by the way. We appreciate knowing about that sort of thing.
Not surprising it didn't get an answer, though. Stack Overflow is strictly a question and answer site so the best you would get over there is "java.lang.ClassNotFoundException always means the class isn't on your classpath". And since the question must have already been asked over there tens of thousands of times already, perhaps SO people are uninterested in answering it yet again.
However beginners are often unaware of what the classpath is, or how to set it, or the fact that it has to be set properly every time you run a Java app, or that it works differently in web apps and executable jars, and on and on. At least here you'll get some discussion about the problem.
Just let me do the talking. Ahem ... so ... you see ... we have this tiny ad...
SKIP - a book about connecting industrious people with elderly land owners