2

I just upgrade my java version to java 7 from java 6 and i am getting this stack trace. I am using java 7_u80. `

Caused by: java.lang.NoClassDefFoundError: Could not initialize class sun.font.SunFontManager
at sun.font.FontDesignMetrics.getMetrics(FontDesignMetrics.java:264)
at sun.java2d.SunGraphics2D.getFontMetrics(SunGraphics2D.java:819)
at org.jfree.text.G2TextMeasurer.getStringWidth(G2TextMeasurer.java:78)
at org.jfree.text.TextUtilities.nextLineBreak(TextUtilities.java:248)
at org.jfree.text.TextUtilities.createTextBlock(TextUtilities.java:187)
at org.jfree.text.TextUtilities.createTextBlock(TextUtilities.java:155)
at org.jfree.chart.plot.PiePlot.drawLeftLabels(PiePlot.java:1822)
at org.jfree.chart.plot.PiePlot.drawLabels(PiePlot.java:1787)
at org.jfree.chart.plot.PiePlot3D.draw(PiePlot3D.java:517)
at org.jfree.chart.JFreeChart.draw(JFreeChart.java:1058)
at org.jfree.chart.JFreeChart.createBufferedImage(JFreeChart.java:1244)
at org.jfree.chart.JFreeChart.createBufferedImage(JFreeChart.java:1223)
at org.jfree.chart.ChartUtilities.writeChartAsPNG(ChartUtilities.java:173)
at org.jfree.chart.ChartUtilities.saveChartAsPNG(ChartUtilities.java:328)
at com.PMSystems.charts.GenerateChart.generatePieChart(GenerateChart.java:340)
at org.apache.jsp.report.PMSCampaignSummaryDetail_jsp._jspService(PMSCampaignSummaryDetail_jsp.java:1886)
        ... 25 more

` This only happen olny when i upgraded the java version any suggestion?

Fazeen Ahmad
  • 63
  • 2
  • 12
  • Upgrade JFreeChart, the version you are using is relying on code in a package that is being removed (Oracle purchased Sun some time ago). – Elliott Frisch Jul 11 '16 at 10:04
  • DO you have pageDef? – user1012506 Jul 11 '16 at 10:04
  • Possible duplicate of [Why am I getting a NoClassDefFoundError in Java?](http://stackoverflow.com/questions/34413/why-am-i-getting-a-noclassdeffounderror-in-java) – CloudPotato Jul 11 '16 at 10:05
  • now i am using **jfreechart-1.0.19.jar** in my class path and getting this exception **java.lang.ClassNotFoundException: org.jfree.chart.labels.StandardPieItemLabelGenerator** – Fazeen Ahmad Jul 11 '16 at 12:42
  • same issue on OpenJDK 64-Bit Server version "11.0.9.1" 2020-11-04 see https://bugzilla.redhat.com/show_bug.cgi?id=1768935 – Donatello Jan 12 '21 at 10:45

2 Answers2

0

I encountered this error while running Android studio with LD_LIBRARY_PATH set to an old location.
Try unsetting LD_LIBRARY_PATH and running again.

0

Same issue encountered on OpenJDK 64-Bit Server version "11.0.9.1" 2020-11-04

see http://bugzilla.redhat.com/show_bug.cgi?id=1768935

It have been solved by moving to Amazon Corretto version "11.0.7" 2020-04-14 LTS

https://docs.aws.amazon.com/corretto/latest/corretto-11-ug/docker-install.html

Donatello
  • 3,486
  • 3
  • 32
  • 38