Is there any Java 8 supported release of SqlJ?

坚强是说给别人听的谎言 提交于 2019-12-23 12:13:50

问题


Actually I am getting an error:

Exception in thread "main" java.lang.NoClassDefFoundError:sun/io/CharToByteConverter

This is because in Java 8, the CharToByteConverter class has been removed as it was deprecated.

Now I want to know of any alternative which would replace this package/class and provide its functionality without throwing the exception mentioned above.

This class is used in the SQLJ's

Translator.jar 

and inside it it is in

sqlj.util.io.OracleOutputStream.class

Edit: If I replace the CharToByteConverter class with the java.nio.charset class, still the SQLJ might not be able to detect it. Please correct me if I am wrong. And let me know if replacing the CharToByteConverter with java.nio.charset might fix the issue?


回答1:


This is an old issue, but WAS an issue for me until today as well. So maybe others may benefit from the information, that Oracle has a bug #21315718 for that, containing the solution: "Translator.jar and runtime12.jar were not compatible with JDK 8. The issue is reported in unpublished Bug 21315718 - sqlj translator does not work with jdk 8." After upgrading these two jars, SQLJ did not raise the above error for me.




回答2:


The javadoc comment says it all:

Deprecated! Replaced - by java.nio.charset

Look for a replacement class/method in the java.nio.charset package.

Note that using classes in the JDK that are not part of the officially documented API is a bad idea in the first place



来源:https://stackoverflow.com/questions/36260631/is-there-any-java-8-supported-release-of-sqlj

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!