I'm running on eclipse what do you mean with command prompt???? I already showed you the error...
Click your windows start button or on windows 8 search for cmd
type in java -version
Paste me your cmd reply
Change these settings to your computer settings
Choose Eclipse -> Preferences
Choose Java -> Installed JREs
Click the Add... button
Choose MacOS X VM or Windows as the JRE type. Press Next.
Example:In the "JRE Home:" field, type /Library/Java/JavaVirtualMachines/1.7.0.jdk/Contents/Home
You should see the system libraries in the list titled "JRE system libraries:"
Give the JRE a name. The recommended name is JDK 1.7. Click Finish.
Check the checkbox next to the JRE entry you just created. This will cause Eclipse to use it as the default JRE for all new Java projects. Click OK.
Now, create a new project. For this verification, from the menu, select File -> New -> Java Project.
In the dialog that appears, enter a new name for your project. For this verification, type Test17Project
In the JRE section of the dialog, select Use default JRE (currently JDK 1.7)