Java Unable to load library ‘gsdll64‘: 报错,解决方案

Posted 小哈里

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Java Unable to load library ‘gsdll64‘: 报错,解决方案相关的知识,希望对你有一定的参考价值。

problem

java.lang.UnsatisfiedLinkError: Unable to load library ‘gsdll64’: ÕҲ»µ½ָ¶¨

at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:166)
at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:239)
at com.sun.jna.Library$Handler.<init>(Library.java:140)
at com.sun.jna.Native.loadLibrary(Native.java:393)
at com.sun.jna.Native.loadLibrary(Native.java:378)
at org.ghost4j.GhostscriptLibraryLoader.loadLibrary(GhostscriptLibraryLoader.java:39)
at org.ghost4j.GhostscriptLibrary.<clinit>(GhostscriptLibrary.java:34)
at org.ghost4j.Ghostscript.initialize(Ghostscript.java:323)
at org.ghost4j.renderer.SimpleRenderer.run(SimpleRenderer.java:105)
at org.ghost4j.renderer.AbstractRemoteRenderer.render(AbstractRemoteRenderer.java:86)
at pdf.converter.img.ImgCreator.process(ImgCreator.java:35)
at pdf.converter.PdfConverter.intoEpub(PdfConverter.java:42)
at pdf.converter.PdfConverterTest.convert(PdfConverterTest.java:21)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69)
at com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(IdeaTestRunner.java:38)
at com.intellij.rt.execution.junit.TestsRepeater.repeat(TestsRepeater.java:11)
at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:35)
at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:235)
at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:54)

Solution 1(失败)

  • 在微软官方下载VS2013的依赖项安装并重启
    https://blog.csdn.net/fgx_123456/article/details/79236425
  • 下载地址
    https://www.microsoft.com/zh-cn/download/details.aspx?id=40784

Solution 2(失败)

  • 根据软件官网的提示,下载相关依赖库
    https://github.com/jmrozanec/pdf-converter/issues/5
  • 下载地址
    https://www.ghostscript.com/releases/index.html

solution3(成功)

  • 网上随便找了个地方下载了缺失的gsdll64.dll并放到系统环境变量下
    https://cn.dll-files.com/download/e151a6bfd1346f078ecdc7984afe47ef/gsdll64.dll.html?c=Z1dYYUpvdlNnaXNHM2dDeTZMRVlSdz09
  • 下载地址:
    https://cn.dll-files.com/gsdll64.dll.html

我是放到C:\\Windows\\System32 (Windows XP, Vista, 7, 8, 8.1, 10).位置然后成功运行的

以上是关于Java Unable to load library ‘gsdll64‘: 报错,解决方案的主要内容,如果未能解决你的问题,请参考以下文章

Java Unable to load library ‘gsdll64‘: 报错,解决方案

如何解决java调dll报Unable to load library的错误

如何解决java调dll报Unable to load library的错误

如何解决java调dll报Unable to load library的错误

如何解决java调dll报Unable to load library的错误

Unable to load performance pack. Using Java I/O instead的解决办法?