diff options
author | Ivo Hinkelmann <ihi@openoffice.org> | 2009-04-02 16:25:40 +0000 |
---|---|---|
committer | Ivo Hinkelmann <ihi@openoffice.org> | 2009-04-02 16:25:40 +0000 |
commit | 93350f1c4e7940c400b145403e58070a7d873026 (patch) | |
tree | e092953367bd5d4e5c0680ec89865612f4be8ca8 /jvmfwk/plugins | |
parent | 423409561c4cb620eeddbc2c5a42154adbd1bb6f (diff) |
CWS-TOOLING: integrate CWS jl119_DEV300
2009-03-13 08:14:58 +0100 jl r269453 : CWS-TOOLING: rebase CWS jl119 to branches/OOO310@269350 (milestone: OOO310:m5)
2009-03-10 16:01:33 +0100 jl r269280 : #i98990# apply patch by jbu: fixing the python script provider
2009-03-10 13:25:02 +0100 jl r269268 : #i93939#
2009-03-10 11:44:07 +0100 jl r269261 : #i93939#
2009-03-09 17:14:58 +0100 jl r269205 : #i93939# choose a different JRE when the selected one was uninstalled
2009-03-09 16:34:34 +0100 jl r269201 : #i93939# choose a different JRE when the selected one was uninstalled
2009-03-05 16:40:16 +0100 jl r268924 : #99618# Do not migrate java settings
2009-02-25 14:29:53 +0100 jl r268439 : #i99618# do not invalidate existing javasettings by using a new date in the update element
Diffstat (limited to 'jvmfwk/plugins')
-rwxr-xr-x | jvmfwk/plugins/sunmajor/javaenvsetup/javaldx.cxx | 36 |
1 files changed, 29 insertions, 7 deletions
diff --git a/jvmfwk/plugins/sunmajor/javaenvsetup/javaldx.cxx b/jvmfwk/plugins/sunmajor/javaenvsetup/javaldx.cxx index 762497b8d8bc..1a6f99f65ba4 100755 --- a/jvmfwk/plugins/sunmajor/javaenvsetup/javaldx.cxx +++ b/jvmfwk/plugins/sunmajor/javaenvsetup/javaldx.cxx @@ -46,6 +46,7 @@ using namespace rtl; static sal_Bool hasOption(char const * szOption, int argc, char** argv); static rtl::OString getLD_LIBRARY_PATH(const rtl::ByteSequence & vendorData); +static bool findAndSelect(JavaInfo**); //static sal_Bool printPaths(const OUString& sPathFile); #define HELP_TEXT \ @@ -95,15 +96,22 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) if (pInfo == NULL) { - errcode = jfw_findAndSelectJRE( & pInfo); - if (errcode == JFW_E_NO_JAVA_FOUND) + if (false == findAndSelect(&pInfo)) + return -1; + } + else + { + //check if the JRE was not uninstalled + sal_Bool bExist = sal_False; + errcode = jfw_existJRE(pInfo, &bExist); + if (errcode == JFW_E_NONE) { - fprintf(stderr,"javaldx: Could not find a Java Runtime Environment! \n"); - return 0; + if (false == findAndSelect(&pInfo)) + return -1; } - else if (errcode != JFW_E_NONE && errcode != JFW_E_DIRECT_MODE) + else { - fprintf(stderr,"javaldx failed!\n"); + fprintf(stderr, "javaldx: Could not determine if JRE still exist\n"); return -1; } } @@ -162,7 +170,21 @@ static sal_Bool hasOption(char const * szOption, int argc, char** argv) return retVal; } - +static bool findAndSelect(JavaInfo ** ppInfo) +{ + javaFrameworkError errcode = jfw_findAndSelectJRE(ppInfo); + if (errcode == JFW_E_NO_JAVA_FOUND) + { + fprintf(stderr,"javaldx: Could not find a Java Runtime Environment! \n"); + return false; + } + else if (errcode != JFW_E_NONE && errcode != JFW_E_DIRECT_MODE) + { + fprintf(stderr,"javaldx failed!\n"); + return false; + } + return true; +} |