java.lang.NoClassDefFoundError: sun/io/CharToByteConverter when Using SQLJ Translator and Java 8 (Doc ID 2073663.1)

Last updated on MAY 26, 2017

Applies to:

SQLJ - Version 12.1.0.2.0 to 12.1.0.2.0 [Release 12.1]
Information in this document applies to any platform.

Symptoms

SQLJ compilation with Java 8 fails with the following error:

$ echo $CLASSPATH
/home/oracle/jdk1.8.0_45/lib:/u01/app/oracle/product/12.1.0/dbhome_1/sqlj/lib/runtime12.jar:/u01/app/oracle/product/12.1.0/dbhome_1/sqlj/lib/translator.jar:/u01/app/oracle/product/12.1.0/dbhome_1/jdbc/lib/ojdbc7.jar:.

$ sqlj -codegen=iso -P-Cfixedchar -status test.sqlj

 

Exception in thread "main" java.lang.NoClassDefFoundError: sun/io/CharToByteConverter
at sqlj.util.io.OracleOutputStreamWriter.<init>(OracleOutputStreamWriter.java:82)
at sqlj.util.io.OracleOutputStreamWriter.<init>(OracleOutputStreamWriter.java:52)
at sqlj.tools.Sqlj.initializeErrors(Sqlj.java:922)
at sqlj.tools.Sqlj.statusMain(Sqlj.java:291)
at sqlj.tools.Sqlj.main(Sqlj.java:164)
Caused by: java.lang.ClassNotFoundException: sun.io.CharToByteConverter
at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 5 more

The same implementation works with Java 7.

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms