Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Error connected mysql java connector to mariadb

Solved Go to solution
Highlighted

Error connected mysql java connector to mariadb

Explorer

i am trying connected mysql java connector to my mariadb using this docs https://docs.cloudera.com/documentation/enterprise/5-16-x/topics/prepare_cm_database.html. I am getting this error messege

 

 

 

[root@cloudera java-1.6.0]# /usr/share/cmf/schema/scm_prepare_database.sh mysql scm scm my_password
JAVA_HOME=/usr/java/jdk1.6.0_31
Verifying that we can write to /etc/cloudera-scm-server
Creating SCM configuration file in /etc/cloudera-scm-server
Executing:  /usr/java/jdk1.6.0_31/bin/java -cp /usr/share/java/mysql-connector-java.jar:/usr/share/java/oracle-connector-java.jar:/usr/share/java/postgresql-connector-java.jar:/usr/share/cmf/schema/../lib/* com.cloudera.enterprise.dbutil.DbCommandExecutor /etc/cloudera-scm-server/db.properties com.cloudera.cmf.db.
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/postgresql/util/PSQLException : Unsupported major.minor version 51.0
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
	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)
Could not find the main class: com.cloudera.enterprise.dbutil.DbCommandExecutor.  Program will exit.
--> Error 1, giving up (use --force if you wish to ignore the error)

 

 

Check java version using "java --version" on terminal

 

 

[root@cloudera java-1.6.0]# java -version
openjdk version "1.8.0_222"
OpenJDK Runtime Environment (build 1.8.0_222-b10)
OpenJDK 64-Bit Server VM (build 25.222-b10, mixed mode)

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Error connected mysql java connector to mariadb

Explorer

Solved,After Set $JAVA_HOME to OpenJDK1.8.0.222(i use open jdk)

1 REPLY 1

Re: Error connected mysql java connector to mariadb

Explorer

Solved,After Set $JAVA_HOME to OpenJDK1.8.0.222(i use open jdk)

Don't have an account?
Coming from Hortonworks? Activate your account here