0

I am using AdoptOpenJDK(version jdk-8.0.212.03) and getting the following error:-

java.lang.NoClassDefFoundError: Could not initialize class java.awt.Font.

Note: I have jdk installed in my machine

I have tried with -Djava.awt.headless=true AND issue disappeared.

But i still didn't able to find the root cause of the issue?

Can anyone help me to find what may be possible cause of the above?

Dvyn Resh
  • 980
  • 1
  • 6
  • 14
learner
  • 332
  • 2
  • 6
  • 22
  • Possible duplicate of [Why am I getting a NoClassDefFoundError in Java?](https://stackoverflow.com/questions/34413/why-am-i-getting-a-noclassdeffounderror-in-java) – Sanjeev Jul 25 '19 at 07:58
  • I understand the link you provided, but i am unable to find the reason behind the issue of java.awt.Font not found issue and why giving that "java.awt.headless=true" fix the issue? Does java unable to use native library? – learner Jul 25 '19 at 09:06
  • It will be very difficult to comment on this without seeing the application code but my hunch is that in headful mode system tries to initialize the font subsystem and could not find the font libraries. When setting mode as headless system did not load font libraries. – Sanjeev Jul 25 '19 at 11:13
  • Okay.thank you for your reply.can you please little bit explain what library is used then to render font in headless mode.how java solve this during the headless mode?and one more questions in headful mode doesn't the java.awt.font in src.zip is used? – learner Jul 25 '19 at 17:58

0 Answers0