summaryrefslogtreecommitdiff
path: root/jvmfwk/source
diff options
context:
space:
mode:
authorJoachim Lingner <jl@openoffice.org>2010-10-26 12:28:33 +0200
committerJoachim Lingner <jl@openoffice.org>2010-10-26 12:28:33 +0200
commit33b3fb4a005f9822b3a3547db3395c816fb870c0 (patch)
tree90ed3001406e1a1cba87d130fb8982b5ac9e22d8 /jvmfwk/source
parent06a5ed97b8ccff99b13cee8a101881b10216fba1 (diff)
jl162 #i115180# fix problems with latest java 1.6.0_22 on MacOS 10.6
Diffstat (limited to 'jvmfwk/source')
-rw-r--r--jvmfwk/source/elements.cxx10
-rw-r--r--jvmfwk/source/framework.cxx48
-rw-r--r--jvmfwk/source/framework.hxx4
3 files changed, 43 insertions, 19 deletions
diff --git a/jvmfwk/source/elements.cxx b/jvmfwk/source/elements.cxx
index 0d14a3909..c2474e5c1 100644
--- a/jvmfwk/source/elements.cxx
+++ b/jvmfwk/source/elements.cxx
@@ -930,6 +930,16 @@ void CNodeJavaInfo::loadFromNode(xmlDoc * pDoc, xmlNode * pJavaInfo)
pDoc, cur->children, 1);
rtl::OUString sRequire = xmlRequire;
nRequirements = sRequire.toInt64(16);
+#ifdef MACOSX
+ //javaldx is not used anymore in the mac build. In case the Java
+ //corresponding to the saved settings does not exist anymore the
+ //javavm services will look for an existing Java after creation of
+ //the JVM failed. See stoc/source/javavm/javavm.cxx. Only if
+ //nRequirements does not have the flag JFW_REQUIRE_NEEDRESTART the
+ //jvm of the new selected JRE will be started. Old settings (before
+ //OOo 3.3) still contain the flag which can be safely ignored.
+ nRequirements ^= JFW_REQUIRE_NEEDRESTART;
+#endif
}
else if (xmlStrcmp(cur->name, (xmlChar*) "vendorData") == 0)
{
diff --git a/jvmfwk/source/framework.cxx b/jvmfwk/source/framework.cxx
index ee8378e78..1f9bb76db 100644
--- a/jvmfwk/source/framework.cxx
+++ b/jvmfwk/source/framework.cxx
@@ -1114,29 +1114,39 @@ javaFrameworkError SAL_CALL jfw_getJRELocations(
javaFrameworkError jfw_existJRE(const JavaInfo *pInfo, sal_Bool *exist)
{
- javaFrameworkError ret = JFW_E_NONE;
- if (!pInfo || !exist)
- return JFW_E_INVALID_ARG;
- ::rtl::OUString sLocation(pInfo->sLocation);
-
- if (sLocation.getLength() == 0)
- return JFW_E_INVALID_ARG;
+ //get the function jfw_plugin_existJRE
+ jfw::VendorSettings aVendorSettings;
+ jfw::CJavaInfo aInfo;
+ aInfo = (const ::JavaInfo*) pInfo; //makes a copy of pInfo
+ rtl::OUString sLibPath = aVendorSettings.getPluginLibrary(aInfo.getVendor());
+ osl::Module modulePlugin(sLibPath);
+ if ( ! modulePlugin)
+ return JFW_E_NO_PLUGIN;
+ rtl::OUString sFunctionName(
+ RTL_CONSTASCII_USTRINGPARAM("jfw_plugin_existJRE"));
+ jfw_plugin_existJRE_ptr pFunc =
+ (jfw_plugin_existJRE_ptr)
+ osl_getFunctionSymbol(modulePlugin, sFunctionName.pData);
+ if (pFunc == NULL)
+ return JFW_E_ERROR;
+
+ javaPluginError plerr = (*pFunc)(pInfo, exist);
- ::osl::DirectoryItem item;
- ::osl::File::RC rc_item = ::osl::DirectoryItem::get(sLocation, item);
- if (::osl::File::E_None == rc_item)
- {
- *exist = sal_True;
- }
- else if (::osl::File::E_NOENT == rc_item)
- {
- *exist = sal_False;
- }
- else
+ javaFrameworkError ret = JFW_E_NONE;
+ switch (plerr)
{
+ case JFW_PLUGIN_E_NONE:
+ ret = JFW_E_NONE;
+ break;
+ case JFW_PLUGIN_E_INVALID_ARG:
+ ret = JFW_E_INVALID_ARG;
+ break;
+ case JFW_PLUGIN_E_ERROR:
+ ret = JFW_E_ERROR;
+ break;
+ default:
ret = JFW_E_ERROR;
}
-
return ret;
}
diff --git a/jvmfwk/source/framework.hxx b/jvmfwk/source/framework.hxx
index 740c52391..91a3aa257 100644
--- a/jvmfwk/source/framework.hxx
+++ b/jvmfwk/source/framework.hxx
@@ -64,6 +64,10 @@ typedef javaPluginError (*jfw_plugin_startJavaVirtualMachine_ptr)(
JavaVM ** ppVM,
JNIEnv ** ppEnv);
+typedef javaPluginError (*jfw_plugin_existJRE_ptr)(
+ const JavaInfo *info,
+ sal_Bool *exist);
+
namespace jfw
{