• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Error running program

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 2412
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic