Is there any Java 8 supported release of SqlJ?
Asked Answered
A

2

6

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?

Anguiano answered 28/3, 2016 at 10:40 Comment(1)
Possible duplicate of #10444629Cobelligerent
C
0

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.

Conformist answered 8/4, 2019 at 15:17 Comment(0)
B
-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

Brahmaputra answered 28/3, 2016 at 10:42 Comment(2)
Instead of copy pasting an answer you should have marked it as duplicate :)Cobelligerent
I have already read this post which suggests what you have mentioned above. However, java.nio.charset is a replacement for the deprecated class CharToByteConverter.class However, I am looking for a replacement for the entire Translator.jar file. The reason being that even if I replace the CharToByteConverter class with charset, it will still cause errors while I use the translator.jar which SQLJ internally uses as a library. I am sorry as I probably wrote my question wrong. Ill edit it to provide a better view of my problem.Anguiano

© 2022 - 2024 — McMap. All rights reserved.