To comment on the following update, log in, then open the issue: http://www.openoffice.org/issues/show_bug.cgi?id=83140
User jl changed the following: What |Old value |New value ================================================================================ Issue type|PATCH |ENHANCEMENT -------------------------------------------------------------------------------- Target milestone|OOo 2.4 |OOo 3.x -------------------------------------------------------------------------------- ------- Additional comments from [EMAIL PROTECTED] Mon Nov 19 15:49:59 +0000 2007 ------- /** an instance of this struct represents an installation of a Java @@ -541,9 +542,11 @@ javaFrameworkError SAL_CALL jfw_getJavaI then the user enabled it. If then the selected JRE has the requirement JFW_REQUIRE_NEEDRESTART then this error is returned. </br> JFW_E_VM_CREATION_FAILED the creation of the JVM failed. The creation is performed - by a plug-in library and not by this API. + by a plug-in library and not by this API.</br> JFW_E_FAILED_VERSION the "Default Mode" is active. The JRE determined by - <code>JAVA_HOME</code>does not meet the version requirements. + <code>JAVA_HOME</code>does not meet the version requirements.</br> + JFW_E_TRY_AUTOSELECT the current setting is wrong but autoselection + is enabled. Let's try it if possible. I do not see where the the information about "autoselection" is obtained. */ javaFrameworkError SAL_CALL jfw_startVM(JavaVMOption *arOptions, sal_Int32 nSize, JavaVM **ppVM, @@ -573,7 +576,9 @@ javaFrameworkError SAL_CALL jfw_startVM( JFW_E_ERROR An error occurred.<br/> JFW_E_CONFIGURATION mode was not properly set or their prerequisites were not met.<br/> - JFW_E_DIRECT_MODE the function cannot be used in this mode. + JFW_E_DIRECT_MODE the function cannot be used in this mode.<br/> + JFW_E_TRY_AUTOSELECT the current setting is wrong but autoselection + is enabled. Let's try it if possible. JFW_E_TRY_AUTOSELECT does not make sense here because this function just writes the information of the selected JRE. There is also no code which gets the information about "auto selection". */ javaFrameworkError SAL_CALL jfw_setSelectedJRE(JavaInfo const *pInfo); @@ -603,7 +608,9 @@ javaFrameworkError SAL_CALL jfw_setSelec JFW_E_CONFIGURATION mode was not properly set or their prerequisites were not met.<br/> JFW_E_INVALID_SETTINGS the javavendors.xml has been changed and no - JRE has been selected afterwards. <br/> + JRE has been selected afterwards.<br/> + JFW_E_TRY_AUTOSELECT the current setting is wrong but autoselection + is enabled. Let's try it if possible. Same here, this function just reads the data. It should not process the information. However, I could think of extending JavaInfo to contain a flag "auto_selected". */ javaFrameworkError SAL_CALL jfw_getSelectedJRE(JavaInfo **ppInfo); --- jvmfwk/plugins/sunmajor/javaenvsetup/javaldx.cxx.old 2006-09-16 19:45:14.000000000 +0200 +++ jvmfwk/plugins/sunmajor/javaenvsetup/javaldx.cxx 2007-10-30 21:04:14.000000000 +0100 @@ -104,7 +104,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) fprintf(stderr,"javaldx failed. User must select a JRE from options dialog!"); return -1; } - else if (errcode != JFW_E_NONE) + else if (errcode != JFW_E_NONE && errcode != JFW_E_TRY_AUTOSELECT) { fprintf(stderr,"javaldx failed! \n"); return -1; Something seems to be missing here. I cannot see how an alternative JRE is selected. ----- I think your idea is good to automatically choose a different JRE in case the user did not manually select the JRE (setSelectedJRE). However, as I indicated I would pass out "the auto selected flag" in the JavaInfo structure and not use this error code JFW_E_TRY_AUTOSELECT. The question is who might be relying on the size of JavaInfo and can it be changed without breaking anyone else code. (I guess it can be changed) javaldx would have to check itself if the folder still exists and if it does not and "autoSelected" was true then it calls jfw_findAndSelectJRE. Then there is the invocation of jfw_startVM in JavaVirtualMachine::getJavaVM (stoc/source/javavm/javavm.cxx). Provided that the JRE was auto selected and then removed, then the function should call jfw_findAndSelectJRE. jfw_startVM should therefore return something like JFW_E_NO_JRE_FOUND. Question is, if this should be determined by the "framework" code or the plugin code. The framework could only check if the folder exists or if it is empty. The plugin could check even more, for example if the libjvm exists. If not then currently the function returns JFW_PLUGIN_E_VM_CREATION_FAILED. One also needs to take care that in the case of Unix, where javaldx is used, java must not be started after selecting a new one by JavaVirtualMachine::getJavaVM. Then the user needs to be notified about restarting the office. However, this should actually rarely occur, since the javaldx already does the check. But then javaldx can only check if the installation directory of the JRE exists or if it is empty. One could also think of a function in the plugin which does the check, for example jfw_plugin_checkInstallation(JavaInfo) which would be indirectly called via the framework. Then every vendor specific implementation (gnujre.hxx, sunjre.hxx, etc.) would have to implement it. ---- For now I will decline the patch, but I will make it an enhancement because providing this mechanism is useful. --------------------------------------------------------------------- Please do not reply to this automatically generated notification from Issue Tracker. Please log onto the website and enter your comments. http://qa.openoffice.org/issue_handling/project_issues.html#notification --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]