Hello everybody, Error: After specifying the Mobilink server to use synchronization scripts I get this error: "Unsupported major.minor version 51.0" Command to compile: I wrote the Java code and compile using this command in the command line: javac -classpath "%SQLANY12%\java\mlscript.jar" MobielCMPSynchronization.java Cause of the problem: I googled around and find out this has to do with the Java JDK version compatibility problem: "It means that you compiled your classes under a specific JDK, but then try to run them under older version of JDK." I have JDK7 installed and use JDK7 to compile the code. Why does it generate this error, since I don't compile and run against different JDK versions... Tried the following: So what I did was I downloaded & installed the older JDK version which is JDK 6.0. In the Eclipse project I specify the JRE to the version 6 (JavaSE-1.6) as the execution environment. So the compiler is using the 1.6 version. I use the command line to run the compile Java classes command. I'm still getting this error. :( Any idea what I can do next... I'm confused now since I have two versions of the JDK now. |
Ok, I fixed this problem by removing the 1.7 version in the control panel > remove software. Compiled the class using -target 1.6 and specified the -jrepath to use "%SQLANY12%Sunjre160_x64" as value when starting the Mobilink server. Just to close this "completely": Does this work without specifying the -jrepath, too? I would think so as the specified version should be used by default.
(02 Feb '12, 07:24)
Volker Barth
Replies hidden
Yes, it works without specifying the -jrepath.
(02 Feb '12, 07:52)
Yanny
|
You could use mlsrv12 -sl java with the -jrepath option to specify the right JRE - if it isn't the default one included with SQL Anywhere 12. - Are the settings of JAVA_HOME different?
What is the default JRE being used by SQLAnywhere 12? How can I check the settings of JAVA_HOME?
The other option, if you are not using any JDK1.7 specific features, is to compile with the -target option so that you force it to run against an older JRE.
From the cited doc:
For the JAVA_HOME, as with any other environment varible in Windows, check within a cmd window with SET JAVA_HOME, or use the Workplace properties dialogs.
I have overriden the -jrepath:
But still getting this error...
When I compile forcing it to use 1.6 version I get this error:
IMHO, the given command line just sets the JRE to the default one... I would have expected that you set it to your freshly downloaded JRE.