-
Notifications
You must be signed in to change notification settings - Fork 221
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
java.lang.NoClassDefFoundError: sun.font.SunFontManager exception when moving from oracle jdk 8 to corretto jdk 1.8.0_362. #466
Comments
I've done a quick local test and wasn't able to reproduce this issue. Is there any additional information you can share that might help reproduce the issue? A minimal code snippet and any command line flags you're using to launch your application might help. |
Thank you for quick analysis and response. Yes. I also verified that SunFontmanager is part of corretto 8 jdk. |
One more input: This an runtime exception i am getting. I am able to compile code successfully. |
Hi @sagar21304
You need to check how you run your application, especially whether you redefine classpaths. |
Hi @eastig, Thank you for your input. What should be the classpath to access SunFontManager.class? Could you please confirm? |
Hi @eastig, there is no change in classpath. Is there any specific change required for corretto 8 classpath? We are loading a jar file using jni api in c++ apllcation.This a classpath passing to jvm. Its working fine with corretto 11 jre. But its not working with corretto 8 jre. Is there anything specific to corretto 8? |
Hi @sagar21304, Do you use I think you might have some configuration issues with it.
I see you have Can you trace class loading? |
There is nothing specific regarding classpath needed for corretto 8. |
Hi @eastig, Thank you for your response. Yes. We are using JNI_CreateJavaVM. After removing rt.jar from the java.class.path its not working with corretto 8 jre. |
@sagar21304 We're experiencing the same issue; did you find a solution/workaround? |
Found a fix for this. Simply install the |
Describe the bug
java.lang.NoClassDefFoundError: sun.font.SunFontManager exception when moving from oracle jdk to corretto jdk 1.8.0_362.
To Reproduce
Build a jar which uses sun.font.SunFontManager with oracle jdk 8 and then migrate to corretto jdk jdk 1.8.0_362.
Expected behavior
It should not throw an java.lang.NoClassDefFoundError: sun.font.SunFontManager exception
Screenshots
May 18, 2023 7:14:15 AM
SEVERE: java.lang.NoClassDefFoundError: sun.font.SunFontManager
May 18, 2023 7:14:15 AM
SEVERE: at java.lang.Class.forName0(Native Method)
May 18, 2023 7:14:15 AM
SEVERE: at java.lang.Class.forName(Class.java:348)
May 18, 2023 7:14:15 AM
SEVERE: at sun.font.FontManagerFactory$1.run(FontManagerFactory.java:82)
May 18, 2023 7:14:15 AM
SEVERE: at java.security.AccessController.doPrivileged(Native Method)
May 18, 2023 7:14:15 AM
SEVERE: at sun.font.FontManagerFactory.getInstance(FontManagerFactory.java:74)
May 18, 2023 7:14:15 AM
SEVERE: at sun.java2d.SunGraphicsEnvironment.getFontManagerForSGE(SunGraphicsEnvironment.java:190)
May 18, 2023 7:14:15 AM
SEVERE: at sun.java2d.SunGraphicsEnvironment.getAllFonts(SunGraphicsEnvironment.java:209)
Platform information
openjdk version "1.8.0_362"
OpenJDK Runtime Environment Corretto-8.362.08.1 (build 1.8.0_362-b08)
OpenJDK Server VM Corretto-8.362.08.1 (build 25.362-b08, mixed mode)
Additional context
It seems sun.font.SunFontManager class is not part of corretto jre 1.8.0_362. However, its working with corretto 11 without any problem.
Expectation: How to load sun.font.* with corretto jre 1.8.0_362 to resolve this issue? What should I do to resolve this?
The text was updated successfully, but these errors were encountered: