compiling a java program

view full story

http://ubuntuforums.org – hello friends, i am new to ubuntu. I want to compile my java program in ubuntu.so i installed open jdk 1.7 in ubuntu through sudo apt-get install command. My java program is class Hai { public static void main(String s[]) { System.out.println("hai"); } } But when i am compiling with javac there is no problem. But with java command i am getting this error: Exception in thread "main" java.lang.UnsupportedClassVersionError: Hai : Unsupported major.minor version 51.0 at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLo (Hardware)