aboutsummaryrefslogtreecommitdiff
path: root/java/org
diff options
context:
space:
mode:
authordcommander <dcommander@632fc199-4ca6-4c93-a231-07263d6284db>2012-08-24 02:44:39 +0000
committerdcommander <dcommander@632fc199-4ca6-4c93-a231-07263d6284db>2012-08-24 02:44:39 +0000
commit28b2bc57cc0009f4518b29a5385a754117f40028 (patch)
tree38bbf7720e67c4838b848b001ae7a0f42cc389d0 /java/org
parent04467abaa1c5a593b55ee65d77d6fe3e461013b9 (diff)
If libturbojpeg.jnilib is not found on Mac systems, specifically look for it under /usr/lib, since /usr/lib isn't part of the default java.library.path on that platform.
git-svn-id: svn://svn.code.sf.net/p/libjpeg-turbo/code/trunk@861 632fc199-4ca6-4c93-a231-07263d6284db
Diffstat (limited to 'java/org')
-rw-r--r--java/org/libjpegturbo/turbojpeg/TJLoader.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/java/org/libjpegturbo/turbojpeg/TJLoader.java b/java/org/libjpegturbo/turbojpeg/TJLoader.java
index db77bba..ded963e 100644
--- a/java/org/libjpegturbo/turbojpeg/TJLoader.java
+++ b/java/org/libjpegturbo/turbojpeg/TJLoader.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C)2011 D. R. Commander. All Rights Reserved.
+ * Copyright (C)2011-2012 D. R. Commander. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -30,6 +30,14 @@ package org.libjpegturbo.turbojpeg;
final class TJLoader {
static void load() {
- System.loadLibrary("turbojpeg");
+ try {
+ System.loadLibrary("turbojpeg");
+ } catch (java.lang.UnsatisfiedLinkError e) {
+ String os = System.getProperty("os.name").toLowerCase();
+ if (os.indexOf("mac") >= 0) {
+ System.load("/usr/lib/libturbojpeg.jnilib");
+ }
+ else throw e;
+ }
}
};