Tizen SDK and Java JDK : Exception in thread "main" java.lang.UnsupportedClassVersionError: org/tizen/ncli/ide/shell/Main : Unsupported major.minor version 51.0


        Java never let you go racing by Formula One, frequency of exception on daily in the world like it happen on Tizen SDK when they have a meeting.

Tizen SDK and Java JDK : Exception in thread "main" java.lang.UnsupportedClassVersionError: org/tizen/ncli/ide/shell/Main : Unsupported major.minor version 51.0

Open Terminal
      type "tizen list native-project" and press enter.

And this error happen
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/tizen/ncli/ide/shell/Main : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:637)
at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)


Check Java version first
      type "java -version" and press enter.

And the result seem like below
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-466.1)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-466.1, mixed mode)


The java version is 1.6.x_x it's too old, please check in this path
/Library/Java/JavaVirtualMachines/

if you have at least 1.7.x_x or 1.8.x_x, for example as this list
jdk1.7.0_79.jdk
jdk1.8.0_112.jdk


It's gonna be ok. Your Terminal still open,
let's type "export JAVA_HOME=`/usr/libexec/java_home -v 1.7`" then type "java -version" again.

the result should be like this.
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
java version "1.7.0_79"
Java(TM) SE Runtime Environment (build 1.7.0_79-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode)


      The java version change to 1.7.x_x, then type "tizen list native-project" and hit enter again, you should see list normally without an error from java like below.
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
-----------------------------------------------------
Starting native-project
-----------------------------------------------------
[PROFILE] [TEMPLATE]
mobile-2.3 basic_edc_ui
mobile-2.3 basic_ui
mobile-2.3 service_app
mobile-2.3 shared_library
mobile-2.3 static_library
mobile-2.3.1 ServiceApp
mobile-2.3.1 SharedLibrary
mobile-2.3.1 StaticLibrary
mobile-2.3.1 basic-edc-ui
mobile-2.3.1 basic-ui
mobile-2.3.1 widgetapp
-----------------------------------------------------
Finished native-project


Test Environment:
- Macbook Pro 13" Retina
- OS X El Capitan
- Java JDK 1.6
- Java JDK 1.7
- Java JDK 1.8
- Tizen SDK

Try to test with java 1.8, it should be fine like java 1.7 also. :)

Comments