I use ghost4j GhostScript to convert PDF to TIF files in a Java Standalone Application.
I included Ghost4J into my project using Maven and installed Ghostscript (Windows) into C:\Program Files\gs... I tested the code in Window's everything worked fine. Life's good.
When I test the same application in Linux, it's not working expected. Gave me the below error.
Exception in thread "ForkJoinPool-1-worker-4" Exception in thread "ForkJoinPool-1-worker-24" Exception in thread "ForkJoinPool-1-worker-25" java.lang.NoClassDefFoundError: Could not initialize class org.ghost4j.GhostscriptLibrary
at org.ghost4j.Ghostscript.initialize(Ghostscript.java:323)
I went through the code again, I am adding the GS libraries to the library path and the able to create the GhostScript instance
System.setProperty("jna.library.path", "C:\\Program Files\\gs\\gs9.19\\bin");
Ghostscript gs = Ghostscript.getInstance();
synchronized (gs) {
gs.initialize(gsArgs);
gs.exit();
}
When running the Linux machine, I am passing gs-919-linux_x86_64
this executable.
Did anyone faced this issue when running Ghostscript in Linux machine ? B.T.W I did not install GhostScript in Linux.