I am trying to get Ghost4j working on my Mac with OS X Lion.
My project works on Windows but on OS X i get following error: Unable to load library 'gs': dlopen(libgs.dylib, 1):
- I installed Ghostscript with Macports: sudo install port Ghostscript
- Added /opt/local/lib to the Path where libgs.dylib is located
- Didn't work so i added a Symbolic link at the project root
- Next I tried to add the Native library to the jar at the Eclipse build path
Stacktrace:
Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load library 'gs': dlopen(libgs.dylib, 1): image not found
at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:145)
at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:188)
at com.sun.jna.Library$Handler.<init>(Library.java:123)
at com.sun.jna.Native.loadLibrary(Native.java:255)
at com.sun.jna.Native.loadLibrary(Native.java:241)
at net.sf.ghost4j.GhostscriptLibraryLoader.loadLibrary(GhostscriptLibraryLoader.java:36)
at net.sf.ghost4j.GhostscriptLibrary.<clinit>(GhostscriptLibrary.java:32)
at net.sf.ghost4j.Ghostscript.initialize(Ghostscript.java:292)
at net.sf.ghost4j.renderer.SimpleRenderer.run(SimpleRenderer.java:83)
at net.sf.ghost4j.renderer.AbstractRemoteRenderer.render(AbstractRemoteRenderer.java:79)
at mhollerw.pdftoimage.ConverterThread.convert(ConverterThread.java:53)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Probably there are problems with 64 bit. (I had problems on windows too with the old Ghost4j version. I solved it by running all in 32Bit. I saw that the new version also works for 64 bit)
Unfortunately i haven't found out the Ghostscript library mode because i can't run it.
I tried to use the vm argument -d32 to run the java vm in 32 Bit mode but this didn't resolve the problem.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am trying to get Ghost4j working on my Mac with OS X Lion.
My project works on Windows but on OS X i get following error: Unable to load library 'gs': dlopen(libgs.dylib, 1):
- I installed Ghostscript with Macports: sudo install port Ghostscript
- Added /opt/local/lib to the Path where libgs.dylib is located
- Didn't work so i added a Symbolic link at the project root
- Next I tried to add the Native library to the jar at the Eclipse build path
… unfortunately nothing worked
Ghost4j: ghost4j-0.4.4.jar
Ghostscript: 9.02
Eclipse: Indigo
OSX: Lion
Stacktrace:
Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load library 'gs': dlopen(libgs.dylib, 1): image not found
at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:145)
at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:188)
at com.sun.jna.Library$Handler.<init>(Library.java:123)
at com.sun.jna.Native.loadLibrary(Native.java:255)
at com.sun.jna.Native.loadLibrary(Native.java:241)
at net.sf.ghost4j.GhostscriptLibraryLoader.loadLibrary(GhostscriptLibraryLoader.java:36)
at net.sf.ghost4j.GhostscriptLibrary.<clinit>(GhostscriptLibrary.java:32)
at net.sf.ghost4j.Ghostscript.initialize(Ghostscript.java:292)
at net.sf.ghost4j.renderer.SimpleRenderer.run(SimpleRenderer.java:83)
at net.sf.ghost4j.renderer.AbstractRemoteRenderer.render(AbstractRemoteRenderer.java:79)
at mhollerw.pdftoimage.ConverterThread.convert(ConverterThread.java:53)
Hi,
Did you try to put all GS .dylib in your project root instead of symlinks ?
Thank you for your quick answer. I tried it now but it didn't work too.
Actually I never tried with Lion. But I remember it worked on Snow Leopard… I will have a closer look at it…
Probably there are problems with 64 bit. (I had problems on windows too with the old Ghost4j version. I solved it by running all in 32Bit. I saw that the new version also works for 64 bit)
Unfortunately i haven't found out the Ghostscript library mode because i can't run it.
I tried to use the vm argument -d32 to run the java vm in 32 Bit mode but this didn't resolve the problem.
Hi,
same issue for me. I'm using Mac OSX Lion 64 bit and I get same error:
Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load library 'gs': dlopen(libgs.dylib, 1): image not found
Any suggestions?
Thanks.
paolofuse