Re: I can compile my progam but I can't run it!

What do you mean you can't run it? How are you trying to run it? What happens when you try? Do you see an error message? If so, what?

I used the Command Prompt!
I did

javac FirstGame.java

then I did

java FirstGame

But it came up with this error:

Exception in thread "main" java.lang.UnsupportedClassVersionError: FirstGame : U
nsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknow n Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$000(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
Could not find the main class: FirstGame. Program will exit.

Re: I can compile my progam but I can't run it!

Originally Posted by KevinWorkman

Classpath != path.

Hi mikaelafiery,

regarding my above post, i am extreamly sorry, class path is the path where where your java .class files will be expected to be present.
what i was talking about was PATH variable in system environment variables.

Re: I can compile my progam but I can't run it!

Originally Posted by b4viral

Hi mikaelafiery,

regarding my above post, i am extreamly sorry, class path is the path where where your java .class files will be expected to be present.
what i was talking about was PATH variable in system environment variables.