[libbluray-devel] Try default locations if environment variable JAVA_HOME is not set
hpi1
git at videolan.org
Wed Oct 3 11:10:54 CEST 2012
libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Fri Sep 28 13:10:21 2012 +0300| [6d0e8f7f1982bae8c7ee2e828a5f36ac9e26a6c4] | committer: hpi1
Try default locations if environment variable JAVA_HOME is not set
> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=6d0e8f7f1982bae8c7ee2e828a5f36ac9e26a6c4
---
src/libbluray/bdj/bdj.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/src/libbluray/bdj/bdj.c b/src/libbluray/bdj/bdj.c
index 8543dae..ac44aaf 100644
--- a/src/libbluray/bdj/bdj.c
+++ b/src/libbluray/bdj/bdj.c
@@ -43,8 +43,14 @@ static void *_load_jvm(void)
{
const char* java_home = getenv("JAVA_HOME"); // FIXME: should probably search multiple directories
if (java_home == NULL) {
- BD_DEBUG(DBG_BDJ | DBG_CRIT, "JAVA_HOME not set, can't find Java VM.\n");
- return NULL;
+ BD_DEBUG(DBG_BDJ | DBG_CRIT, "JAVA_HOME not set, trying default locations\n");
+
+ void *h = dl_dlopen("libjvm", NULL);
+ if (h) {
+ return h;
+ }
+
+ java_home = "/usr/lib/jvm/default-java/";
}
#ifdef WIN32
More information about the libbluray-devel
mailing list