I have been teaching young developers for a decade. And year after year I see those youngsters run into the same problems over and over again. And part of those problems seems to be related with the cryptic ways Java has chosen to explain developers about the problem at hand.
I have chosen five of my personal bizarre error messages which are stopping young Padawans to make progress.
- What is this JAR and why do I need it? Unable to locate tools.jar. Expected to find it in C:\Java\jre\lib\tools.jar
- Do I need to toss in more RAM? java.lang.OutOfMemoryError: Java heap space
- What version do I have to support? java.lang.UnsupportedClassVersionError: Unsupported major.minor eu.plumbr.demo.version.Main version (49.0)
- I cannot access a public method? java.lang.IllegalAccessException: Class eu.plumbr.demo.accessor.Accessor can not access a member of class eu.plumbr.demo.accessordiff.Accessible with modifiers "public"
- An Invoice is not an Invoice? Exception in thread "main" java.lang.ClassCastException: eu.plumbr.demo.classcast.Invoice cannot be cast to eu.plumbr.demo.classcast.Invoice
All of the aforementioned are not easy to grasp if you are new to a platform. And if anyone can shed a light upon why the messages are designed in such a cryptic way, I am more to eager to have the feedback to my blog post.