In order to avoid a functional regression with previous releases, the JAR file needs to be able to load either the 64-bit or 32-bit JNI library on Un*x systems.
This commit is contained in:
17
java/README
17
java/README
@@ -37,7 +37,16 @@ pre-allocating the buffers is recommended.
|
|||||||
Installation Directory
|
Installation Directory
|
||||||
----------------------
|
----------------------
|
||||||
|
|
||||||
If the TurboJPEG JNI library (libturbojpeg.so, libturbojpeg.jnilib, or
|
The TurboJPEG Java Wrapper will look for the TurboJPEG JNI library
|
||||||
turbojpeg.dll) is not installed under a system library directory or under a
|
(libturbojpeg.so, libturbojpeg.jnilib, or turbojpeg.dll) in the system library
|
||||||
directory specified in LD_LIBRARY_PATH (Unix) or PATH (Windows), then you will
|
paths or in any paths specified in LD_LIBRARY_PATH (Unix), DYLD_LIBRARY_PATH
|
||||||
need to pass an argument of -Djava.library.path={path_to_JNI_library} to java.
|
(Mac), or PATH (Windows.) Failing this, on Unix and Mac systems, the wrapper
|
||||||
|
will look for the JNI library under the library directory configured when
|
||||||
|
libjpeg-turbo was built. If that library directory is
|
||||||
|
/opt/libjpeg-turbo/lib32, then /opt/libjpeg-turbo/lib64 is also searched, and
|
||||||
|
vice versa.
|
||||||
|
|
||||||
|
If you installed the JNI library into another directory, then you will need
|
||||||
|
to pass an argument of -Djava.library.path={path_to_JNI_library} to java, or
|
||||||
|
manipulate LD_LIBRARY_PATH, DYLD_LIBRARY_PATH, or PATH to include the directory
|
||||||
|
containing the JNI library.
|
||||||
|
|||||||
@@ -41,7 +41,18 @@ final class TJLoader {
|
|||||||
System.load("/usr/lib/libturbojpeg.jnilib");
|
System.load("/usr/lib/libturbojpeg.jnilib");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
System.load("%{__libdir}/libturbojpeg.so");
|
try {
|
||||||
|
System.load("%{__libdir}/libturbojpeg.so");
|
||||||
|
} catch (java.lang.UnsatisfiedLinkError e3) {
|
||||||
|
String libdir = "%{__libdir}";
|
||||||
|
if (libdir.equals("/opt/libjpeg-turbo/lib64")) {
|
||||||
|
System.load("/opt/libjpeg-turbo/lib32/libturbojpeg.so");
|
||||||
|
} else if (libdir.equals("/opt/libjpeg-turbo/lib32")) {
|
||||||
|
System.load("/opt/libjpeg-turbo/lib64/libturbojpeg.so");
|
||||||
|
} else {
|
||||||
|
throw e3;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user