2

Today I've started to get this warning in the console, when I try to compile my programs with javac:

warning: Blabla.class: major version 52 is newer than 51, the highest major version supported by this compiler.

it is recommended that the compiler be upgraded.

But how can I do that?

PS. command javac -version returns 1.7.0_85, while java -version returns 1.8.0_66. I do not know how this mixture has happened.

Jacobian
  • 194

1 Answers1

5

You have more than one Java version installed and you are using different versions for java and javac. javac -version returns 1.7.0_85, while java -version returns 1.8.0_66. This means that javaccreates bytecode for Java 7 and you try to compile a version for Java 8.

Execute

sudo update-alternatives --config javac

and select Java 8 to solve your problem.

cl-netbox
  • 31,163
  • 7
  • 94
  • 131
A.B.
  • 90,397