-1

I am having a problem where if a computer is using anything lower than the latest java7 runtime environment, when they click on the jar file, it says, "Cannot find the main class: xxx. Program will exit'.

I don't understand why it does this on java6 Runtime. Any ideas? Thanks guys.

NJGUY
  • 2,045
  • 3
  • 23
  • 43
  • 2
    Did you compile your jar with JDK 7? – Jeffrey Jun 15 '12 at 16:24
  • Does the main class reference a JDK 7 class? The class might not even be able to be loaded in JDK 6, leading to this misleading error message. Could you provide the code of the main class? – John Watts Jun 15 '12 at 16:24
  • 2
    If this is related to your [previous question](http://stackoverflow.com/questions/11051838/cannot-find-main-class-java-error) it's likely not appropriate to ask it again. – Dave Newton Jun 15 '12 at 16:25
  • 1
    I'll bet it's not a bug. Better to assume that you've misunderstood. – duffymo Jun 15 '12 at 16:31

1 Answers1

0

Something is wrong at the OS level rather than in Java. For instance, the accepted answer to Executing a Jar on Vista with a double click explains that you need to have the file associations set up correctly on a Windows OS for double-click to work on a JAR file.

Community
  • 1
  • 1
Stephen C
  • 698,415
  • 94
  • 811
  • 1,216