To fix the exception/ error, you should try to either run the Java code with a newer version of Java JRE or specify the target parameter to the Java compiler to instruct the compiler to create code compatible with earlier Java versions.
javac -target 1.4 HelloWorld.java