From: Stephan Bergmann Date: Mon, 21 Feb 2022 10:55:21 +0000 (+0100) Subject: Avoid unnecessary empty -Djava.class.path= X-Git-Tag: archive/raspbian/1%7.0.4-4+rpi1+deb11u6^2~1 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=dd752ab095b1d76b848a6a7412cee0a81ce8c31f;p=libreoffice.git Avoid unnecessary empty -Djava.class.path= Change-Id: Idcfe7321077b60381c0273910b1faeb444ef1fd8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130242 Tested-by: Jenkins Reviewed-by: Stephan Bergmann Gbp-Pq: Name avoid-empty-java.class.path.diff --- diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx index abe47b56783..257b91d76de 100644 --- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx +++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx @@ -712,17 +712,22 @@ javaPluginError jfw_plugin_startJavaVirtualMachine( // all versions below 1.5.1 options.emplace_back("abort", reinterpret_cast(abort_handler)); bool hasStackSize = 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: + OString sAddPath = getPluginJarPath(pInfo->sVendor, pInfo->sLocation,pInfo->sVersion); +#endif for (int i = 0; i < cOptions; i++) { OString opt(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 (opt.startsWith("-Djava.class.path=")) { - OString sAddPath = getPluginJarPath(pInfo->sVendor, pInfo->sLocation,pInfo->sVersion); if (!sAddPath.isEmpty()) + { opt += OStringChar(SAL_PATHSEPARATOR) + sAddPath; + sAddPath.clear(); + } } #endif if (opt == "-Xint") { @@ -767,6 +772,11 @@ javaPluginError jfw_plugin_startJavaVirtualMachine( } #endif } +#ifdef UNX + if (!sAddPath.isEmpty()) { + options.emplace_back("-Djava.class.path=" + sAddPath, nullptr); + } +#endif std::unique_ptr sarOptions(new JavaVMOption[options.size()]); for (std::vector