Java Error Messages
JVM language, the JDK tools and runtime.All Java pages
- Error: Could not find or load main classJava cannot find the class you asked it to run: a package class run by its short name, or a wrong -cp. Use the fully qualified name from the root. Real output.
- java.lang.NullPointerException: Cannot invoke "String.length()" because "name" is nullJava's helpful NullPointerException names the call that failed and the null variable. Why it can say <local1> instead of a name, and how to fix the null.
- java.lang.UnsupportedClassVersionError: compiled by a more recent version of the Java RuntimeUnsupportedClassVersionError means a class was compiled for a newer Java than the JVM running it. Use a newer JDK, or compile with javac --release N instead.
- javac error: cannot find symboljavac cannot find symbol means an identifier is not resolved: a missing import, a typo, a variable out of scope or a missing JAR. Read the symbol line.