Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Myself1
Contributor III
Contributor III

Talend Open Studio For Big Data 7.3.1 & OpenJDK Azul Zulu 11.68.17

Dear Community,

Up to now, we are using Talend Open Studio For Big Data 7.3.1 with Oracle java version "1.8.0_231".

We have to remove any Oracle Java component, so based on your recommandations (https://help.talend.com/r/en-US/7.3/installation-guide-windows/compatible-java-environments), we installed OpenJDK Azul Zulu 11.68.17 , then we activated it such as primary JDK (PATH setting).

Then we are facing the following issue, we get the error message :

Exception in thread "Thread-1" java.lang.NoClassDefFoundError: sun/misc/BASE64Encoder

...

Caused by: java.lang.ClassNotFoundException: sun.misc.BASE64Encoder

   at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)

   at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)

   at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:527)

Here's a part of the code of some jobs :

String s = context.jira_gdpr_user + ":" + context.jira_gdpr_pwd;

globalMap.put("authorization", 

new sun.misc.BASE64Encoder().encode(s.getBytes()).replace("\r", "").replace("\n", ""));

Because we have a lot of jobs using this class and we don't wish to modify all those jobs, what's the best way to fix this issue ?

Are there any other knowed issues due to this JDK migration ?

Regards,

Labels (2)
1 Solution

Accepted Solutions
Myself1
Contributor III
Contributor III
Author

Hi Sabrina,

 

Yes, we finally decided to replace the used code for JDK 8 by

 

import java.util.Base64;

// ...

String encoded = Base64.getEncoder().encodeToString(bBytes);

byte[] decoded = Base64.getDecoder().decode(encoded);

 

Regards,

View solution in original post

4 Replies
Myself1
Contributor III
Contributor III
Author

To Fix it : https://stackoverflow.com/questions/62193303/java-11-patch-sun-misc-base64encoder

Anonymous
Not applicable

Hello,

Thanks for posting this issue here. Is there any update for it?

Was it already resolved on your side from java-11-patch-sun-misc-base64encoder?

Best regards

Sabrina

Myself1
Contributor III
Contributor III
Author

Hi Sabrina,

 

Yes, we finally decided to replace the used code for JDK 8 by

 

import java.util.Base64;

// ...

String encoded = Base64.getEncoder().encodeToString(bBytes);

byte[] decoded = Base64.getDecoder().decode(encoded);

 

Regards,

Anonymous
Not applicable

Hello,

Thanks for your prompt reply and sharing the solution us on Community.

Best regards

Sabrina