You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by ar...@apache.org on 2022/10/31 08:32:09 UTC
[openoffice] branch path updated: Set the default JVM classpath to $OOO_BASE_DIR/program
This is an automated email from the ASF dual-hosted git repository.
ardovm pushed a commit to branch path
in repository https://gitbox.apache.org/repos/asf/openoffice.git
The following commit(s) were added to refs/heads/path by this push:
new 75377b82eb Set the default JVM classpath to $OOO_BASE_DIR/program
75377b82eb is described below
commit 75377b82ebafee6616c1092f5f2b49ab5d694fba
Author: Arrigo Marchiori <ar...@yahoo.it>
AuthorDate: Mon Oct 31 09:31:19 2022 +0100
Set the default JVM classpath to $OOO_BASE_DIR/program
---
.../plugins/sunmajor/pluginlib/sunjavaplugin.cxx | 32 +++++++++++++++-------
1 file changed, 22 insertions(+), 10 deletions(-)
diff --git a/main/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx b/main/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
index 5134122491..3c1edd1419 100644
--- a/main/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
+++ b/main/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
@@ -527,23 +527,38 @@ javaPluginError jfw_plugin_startJavaVirtualMachine(
for (int i = 0; i < cOptions; i++)
{
rtl::OString sOptionString = arOptions[i].optionString;
-#ifdef UNX
- // Until java 1.5 we need to put a plugin.jar or javaplugin.jar (<1.4.2)
- // in the class path in order to have applet support.
if (sOptionString.match(sClassPathProp, 0) == sal_True)
{
+ // This option sets the class path
bool emptyClassPath = (sOptionString == sClassPathProp);
char sep[] = {SAL_PATHSEPARATOR, 0};
- OString sAddPath = getPluginJarPath(pInfo->sVendor, pInfo->sLocation,pInfo->sVersion);
+ OString sAddPath;
+ sClassPathOption = sOptionString;
+ // Add the installation directory as default class path
+ OUString macro(RTL_CONSTASCII_USTRINGPARAM("$OOO_BASE_DIR/program"));
+ rtl::Bootstrap::expandMacros(macro);
+ OUString instDirectory;
+ osl_getSystemPathFromFileURL(macro.pData, &instDirectory.pData);
+ sAddPath = rtl::OUStringToOString(instDirectory, RTL_TEXTENCODING_UTF8);
+ if (sAddPath.getLength()) {
+ if (!emptyClassPath) {
+ sClassPathOption += rtl::OString(sep);
+ }
+ sClassPathOption += sAddPath;
+ emptyClassPath = false;
+ }
+#ifdef UNX
+ // Until java 1.5 we need to put a plugin.jar or javaplugin.jar (<1.4.2)
+ // in the class path in order to have applet support.
+ sAddPath = getPluginJarPath(pInfo->sVendor, pInfo->sLocation,pInfo->sVersion);
if (sAddPath.getLength()) {
- sClassPathOption = sOptionString;
if (!emptyClassPath) {
sClassPathOption += rtl::OString(sep);
}
sClassPathOption += sAddPath;
emptyClassPath = false;
- } else
- sClassPathOption = sOptionString;
+ }
+#endif
if (!emptyClassPath) {
vecOptions.push_back(JavaVMOption());
vecOptions.back().optionString = (char *) sClassPathOption.getStr();
@@ -552,13 +567,10 @@ javaPluginError jfw_plugin_startJavaVirtualMachine(
}
else
{
-#endif
vecOptions.push_back(JavaVMOption());
vecOptions.back().optionString = arOptions[i].optionString;
vecOptions.back().extraInfo = arOptions[i].extraInfo;
-#ifdef UNX
}
-#endif
sOptionString = vecOptions.back().optionString;
if (sOptionString.match(sClassPathProp, 0) == sal_True) {
// Check for empty entries in the class path