I am trying to compile Java code, with Sun Java JDK 1.7.0_17, on a Linux Mint system, but I'm getting this problem.
$ javac -version -target 1.7
javac 1.7.0_17
javac: invalid target release: 1.7
-target 1.6 doesn't work either. Target 1.5 works, but I get a version problem as such,
$ javac -version -target 1.5 HelloWorld.java
javac 1.7.0_17
HelloWorld.java:2: cannot access java.lang.Object
bad class file: /usr/lib/jvm/jdk1.7.0_17/jre/lib/rt.jar(java/lang/Object.class)
class file has wrong version 51.0, should be 49.0
Please remove or make sure it appears in the correct subdirectory of the classpath.
class HelloWorldApp {
^
1 error
Is there somewhere a list of available java targets outside of the sun java directories?
I have no ClassPath or Javahome specified, and setting them doesn't help. jcontrol doesn't help. I have also tried with 1.7.0_15, with similar results.