File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error running program

 
R Shetty
Greenhorn
Posts: 7
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Beginner question:

I'm new to Java and want to know how to compile class in a different folder than C:\Program Files\Java\jdk1.5.0_06\bin (which is what is set as my path variable)

Compiling and running a file saved there works fine but when I move the source file to a different folder say C:\TestJava the compilation works but running the file gets me this error:

"Exception in thread "main".UnsupportedClassVersionError...

Thank you for your help

R
 
Keith Lynn
Ranch Hand
Posts: 2399
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My guess is that you have a JVM installed as a plug-in to a browser or something like that on your machine, and the path to it's bin directory is in your PATH, but the bin directory of your JDK installation is either in the PATH after that location or is not in your PATH. I would check the PATH and add the bin directory of your JDK installation before any other locations that might contain an interpreter.
 
R Shetty
Greenhorn
Posts: 7
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Keith, thank you very much for your help!

Very fast response and your suggestion worked. I did not scroll down far enough in the system variables to see the PATH and so created one in the user variables. When I saw it I deleted the one I created and put the bin path as the first one in the Path variable.

R
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic