Friends,
I have just downloaded Netbeans IDE 5.0 from Sun's website and installed it on my SuSE 10.0 box. I'm trying to play with java, but in the first minute I had a problem. Here is my code in the netbeans:
Code:
package javaapplication1;
public class Main {
/** Creates a new instance of Main */
public Main()
{
}
public static void main(String[] args)
{
System.out.println("Hello World");
}
}
When I compile and run the projects within Netbeans, the output is as follows:
Code:
init:
deps-jar:
compile:
run:
Hello World
BUILD SUCCESSFUL (total time: 0 seconds)
In the dist directory, there is a README.TXT file that tells me to type the following to run the program from the console:
Code:
java -jar "JavaApplication1.jar"
I get the following error messages:
Code:
Exception in thread "main" java.lang.UnsupportedClassVersionError: javaapplication1/Main (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)
How can I run my applications from the console as Netbeans does? I don't understand why netbeans compile easily and my command doesn't?
Thanks for your assistance as always.
Regards.