Post the entire error message, including stacktrace. Like this there is little to say about it other than "something is wrong".
Also just to be 100% sure: how are you running this Java program? From an IDE, on the command line? If on the command line, using what exact command?
And to be 200% sure: what does java -version print?