diff options
author | Michael Meeks <michael.meeks@suse.com> | 2012-02-16 12:38:24 +0000 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2012-02-16 12:45:41 +0000 |
commit | 3823c4fbbaa5e9f73c37a5e66f63640d59eb20cf (patch) | |
tree | a4a4263c3c56990aea99cf830174aa890119d237 /stoc/source | |
parent | 4f582dcef035c1ccdc8ec00bc8c2560bfd49064b (diff) |
java: add STOC_FORCE_NO_JRE env. var to enable easy testing of no-JRE case.
Diffstat (limited to 'stoc/source')
-rw-r--r-- | stoc/source/javavm/javavm.cxx | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/stoc/source/javavm/javavm.cxx b/stoc/source/javavm/javavm.cxx index 14437eec041b..2c900d27c2db 100644 --- a/stoc/source/javavm/javavm.cxx +++ b/stoc/source/javavm/javavm.cxx @@ -782,8 +782,12 @@ JavaVirtualMachine::getJavaVM(css::uno::Sequence< sal_Int8 > const & rProcessId) JNIEnv * pMainThreadEnv = 0; javaFrameworkError errcode = JFW_E_NONE; - errcode = jfw_startVM(arOptions, index, & m_pJavaVm, - & pMainThreadEnv); + + if (getenv("STOC_FORCE_NO_JRE")) + errcode = JFW_E_NO_SELECT; + else + errcode = jfw_startVM(arOptions, index, & m_pJavaVm, + & pMainThreadEnv); bool bStarted = false; switch (errcode) @@ -794,6 +798,8 @@ JavaVirtualMachine::getJavaVM(css::uno::Sequence< sal_Int8 > const & rProcessId) // No Java configured. We silenty run the java configuration // Java. javaFrameworkError errFind = jfw_findAndSelectJRE( NULL ); + if (getenv("STOC_FORCE_NO_JRE")) + errFind = JFW_E_NO_JAVA_FOUND; if (errFind == JFW_E_NONE) { continue; |