Is there a supported Java 8 release of SqlJ?

I actually get the error message:

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

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

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

This class is used in SQLJ.

 Translator.jar 

and inside it is

 sqlj.util.io.OracleOutputStream.class 

Edit: If I replaced the CharToByteConverter class with the java.nio.charset class, SQLJ may not be able to detect it. Please correct me if I am wrong. And let me know if replacing CharToByteConverter with java.nio.charset can solve the problem?

+5
source share
2 answers

This is an old problem, but there was a problem for me today. Therefore, perhaps others can benefit from the information that Oracle has error # 21315718 for this, containing a solution: "Translator.jar and runtime12.jar were not compatible with JDK 8. The problem is reported in unpublished error 21315718 - sqlj translator does does not work with JDK 8. "After updating these two jars, SQLJ did not cause the above error for me.

0
source

The javadoc comment says it all:

Outdated! 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

-1
source

Source: https://habr.com/ru/post/1245897/


All Articles