diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2007-12-06 16:44:40 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2007-12-06 16:44:40 +0000 |
commit | 53f39554ba93a80abe5033d28a57925247b3f0a0 (patch) | |
tree | a1d0f1260e5499ab5672bbd8f402c484df37587f /jvmfwk | |
parent | 97d5f894a5c268af6563219a94a2fdf9751f177e (diff) |
INTEGRATION: CWS jl77 (1.14.8); FILE MERGED
2007/11/19 13:29:13 jl 1.14.8.1: #i80975# applied patch, searching libjjvm by java.library.path
Diffstat (limited to 'jvmfwk')
-rw-r--r-- | jvmfwk/plugins/sunmajor/pluginlib/gnujre.cxx | 42 |
1 files changed, 36 insertions, 6 deletions
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/gnujre.cxx b/jvmfwk/plugins/sunmajor/pluginlib/gnujre.cxx index ba5abb6f88c2..25a2ff497c00 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/gnujre.cxx +++ b/jvmfwk/plugins/sunmajor/pluginlib/gnujre.cxx @@ -4,9 +4,9 @@ * * $RCSfile: gnujre.cxx,v $ * - * $Revision: 1.14 $ + * $Revision: 1.15 $ * - * last change: $Author: hr $ $Date: 2007-11-02 15:23:47 $ + * last change: $Author: vg $ $Date: 2007-12-06 17:44:40 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -72,10 +72,11 @@ char const* const* GnuInfo::getJavaExePaths(int * size) char const* const* GnuInfo::getRuntimePaths(int * size) { static char const* ar[]= { - "/lib/" GCJ_JFW_PLUGIN_ARCH "/client/libjvm.so", - "/gcj-4.1.1/libjvm.so", - "/libgcj.so.7", - "/libgcj.so.6" + "/libjvm.so", + "/lib/" GCJ_JFW_PLUGIN_ARCH "/client/libjvm.so", + "/gcj-4.1.1/libjvm.so", + "/libgcj.so.7", + "/libgcj.so.6" }; *size = sizeof(ar) / sizeof (char*); return ar; @@ -87,6 +88,7 @@ bool GnuInfo::initialize(vector<pair<OUString, OUString> > props) //javax.accessibility.assistive_technologies from system properties OUString sVendor; + OUString sJavaLibraryPath; typedef vector<pair<OUString, OUString> >::const_iterator it_prop; OUString sVendorProperty( RTL_CONSTASCII_USTRINGPARAM("java.vendor")); @@ -94,6 +96,8 @@ bool GnuInfo::initialize(vector<pair<OUString, OUString> > props) RTL_CONSTASCII_USTRINGPARAM("java.version")); OUString sJavaHomeProperty( RTL_CONSTASCII_USTRINGPARAM("java.home")); + OUString sJavaLibraryPathProperty( + RTL_CONSTASCII_USTRINGPARAM("java.library.path")); OUString sGNUHomeProperty( RTL_CONSTASCII_USTRINGPARAM("gnu.classpath.home.url")); OUString sAccessProperty( @@ -103,6 +107,7 @@ bool GnuInfo::initialize(vector<pair<OUString, OUString> > props) bool bVendor = false; bool bHome = false; bool bJavaHome = false; + bool bJavaLibraryPath = false; bool bAccess = false; typedef vector<pair<OUString, OUString> >::const_iterator it_prop; @@ -139,6 +144,12 @@ bool GnuInfo::initialize(vector<pair<OUString, OUString> > props) } } } + else if (!bJavaLibraryPath && sJavaLibraryPathProperty.equals(i->first)) + { + sal_Int32 nIndex = 0; + osl_getFileURLFromSystemPath(i->second.getToken(0, ':', nIndex).pData, &sJavaLibraryPath.pData); + bJavaLibraryPath = true; + } else if (!bAccess && sAccessProperty.equals(i->first)) { if (i->second.getLength() > 0) @@ -199,6 +210,25 @@ bool GnuInfo::initialize(vector<pair<OUString, OUString> > props) } } + // try to find it by the java.library.path property + if (!bRt && m_sJavaHome != sJavaLibraryPath) + { + m_sHome = sJavaLibraryPath; + for(i_path ip = libpaths.begin(); ip != libpaths.end(); ip++) + { + //Construct an absolute path to the possible runtime + OUString usRt= m_sHome + *ip; + DirectoryItem item; + if(DirectoryItem::get(usRt, item) == File::E_None) + { + //found runtime lib + m_sRuntimeLibrary = usRt; + bRt = true; + break; + } + } + } + #ifdef X86_64 //Make one last final legacy attempt on x86_64 in case the distro placed it in lib64 instead if (!bRt && m_sJavaHome != rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("file:///usr/lib"))) |