0

I have simple jar which includes the class MainClass with static start and stop methods. When I use JDK6 and Prunsrv my service starts and stops successfully. When I switch to JDK I get this error when I start the service:

java.lang.UnsupportedClassVersionError: org/serv/MainClass : Unsupported major.minor version 52.0

How can I resolve this problem?

Magnilex
  • 11,584
  • 9
  • 62
  • 84
DArt
  • 45
  • 6

1 Answers1

0

I've encountered this before.

It's usually due to the Java classes being compiled for one Java version (i.e. JSE 8) but they are ran with another (i.e. JSE 6).

Check your paths and make sure the appropriate version of the JVM is running the code.

See also:

Community
  • 1
  • 1
  • When I use some jdk I compile with it and launch with it. I didn't launch in java6 classes compiled in java8. – DArt Feb 01 '15 at 09:23