You've got multiple versions of Java installed, and the one you're using to compile the program is newer than the one you're using to run it; specifically, the compiler is JDK 1.5, and the runtime is JDK 1.4 or earlier.
Often when you install the Java plug-in for your Web browser, it will stick a copy of java.exe into your WINDOWS folder or someplace else early on your PATH. You have a number of options: uninstalling the plugin and installing a newer version is one; changing your PATH to put the JDK/bin directory first is another.
If you're running on windows, you might want to use something like this "setjava.bat" script:
You could put it in your project directory, or in a global "utilities" directory.
You could use it as follows:
'Hope that helps .. PSM [ December 04, 2005: Message edited by: Paul Santa Maria ]
Paul M. Santa Maria, SCJP
Joined: Dec 04, 2005
Hello Paul and Ernest!
With the help of both of you, I was able to figure it out. I had installed an Oracle demo on my machine and it had references to Java in the path. I moved them to the end of the path, after which my simple little app worked fine.