Start New Discussion within our Software Development Community

Hey all

I started learning java and I installed it on my Desktop(XP) and it was fine I could run the programs I made it was all good. When I came round to installing java on my laptop running Ubuntu I followed the guide here
http://www.wikihow.com/Install-Java-on-Linux
I I followed the Ubuntu Console method and it all installed fine.

I treied to run the following simple program just to test it out to see of the install was ok

public class Hellojava
{
	public static void main(String[] args)
	{
		System.out.println("Hello Java");
	}
}

and here is what i typed at the terminal, and the response I got which I do not understand.

hla@box:~/source/java$ javac Hellojava.java
hla@box:~/source/java$ java Hellojava
Exception in thread "main" java.lang.UnsupportedClassVersionError: Hellojava (Unsupported major.minor version 49.0)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:539)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
hla@box:~/source/java$

Can anyone tell me what's going wrong please? DId i do something wrong or what?

Many thanks

HLA91

This article has been dead for over six months. Start a new discussion instead.