【发布时间】:2014-05-19 07:50:24
【问题描述】:
如果我从 Eclipse 运行项目 - 没关系。如果我将项目作为可运行的 jar 异常运行:
.Exception in thread "main" java.lang.ExceptionInInitializerError
at de.intarsys.pdf.platform.cwt.font.freetype.FreetypeFontFactory.getLib
rary(Unknown Source)
at de.intarsys.pdf.platform.cwt.font.freetype.FreetypeFontFactory.create
PlatformFont(Unknown Source)
at de.intarsys.pdf.platform.cwt.rendering.CSPlatformDevice.textSetFont(U
nknown Source)
at de.intarsys.pdf.content.CSDeviceBasedInterpreter.render_Tf(Unknown So
urce)
at de.intarsys.pdf.content.CSInterpreter.process(Unknown Source)
at de.intarsys.pdf.content.CSInterpreter.process(Unknown Source)
at de.intarsys.pdf.content.CSDeviceBasedInterpreter.process(Unknown Sour
ce)
at RenderDoc.renderPage(RenderDoc.java:75)
at RenderDoc.renderPages(RenderDoc.java:97)
at RenderDoc.run(RenderDoc.java:139)
at RenderDoc.main(RenderDoc.java:48)
Caused by: java.lang.NullPointerException: no native interface available
at de.intarsys.nativec.api.NativeInterface.set(Unknown Source)
at de.intarsys.nativec.api.NativeInterface.get(Unknown Source)
at de.intarsys.cwt.freetype.nativec._FTNI.init(Unknown Source)
at de.intarsys.cwt.freetype.nativec._FTNI.<init>(Unknown Source)
at de.intarsys.cwt.freetype.Freetype.<clinit>(Unknown Source)
... 11 more
我的系统 windows7 64 位,java 8 64 位。我认为问题在于,在 Eclipse 之外没有看到 freetype.dll。我在 jar(jpod 依赖项)中找到了它。我怎样才能在包装 jar 中正确包含这个 dll,为什么它可以在 eclipse 中工作?
【问题讨论】:
标签: java eclipse java-native-interface jna freetype