diff options
author | Christian Georgi | 2015-03-30 20:45:05 +0000 |
---|---|---|
committer | Arun Thondapu | 2015-04-21 17:23:04 +0000 |
commit | ead8061d709b1279743a6873f146c2c250d1df45 (patch) | |
tree | 93cf822bc537201079839ab86a5ceb1b89675eaf | |
parent | 44336d8123b71d1df865d51e0f2eaf2e1bad615f (diff) | |
download | rt.equinox.framework-ead8061d709b1279743a6873f146c2c250d1df45.tar.gz rt.equinox.framework-ead8061d709b1279743a6873f146c2c250d1df45.tar.xz rt.equinox.framework-ead8061d709b1279743a6873f146c2c250d1df45.zip |
Bug 444201 - Make embedded JVM work again on MacOS
With the new native MacOS file system layout (bug 431116) any embedded JVM
will fail to start. Reason is a too simple detection of the JVM bundle
based on the existence of a /Contents/ path segment, which now happens to
always be there and causes the JVM to be loaded at the Eclipse.app/ location
instead of at the embedded JVM bundle location. Fix is to check for
/Contents/Home/ which should be unique enough for MacOS JVM bundles.
This also fixes bug 442324's issue of a wrongly required legacy Apple JVM even
if a JVM is embedded.
Bug: 442324
Bug: 444201
Change-Id: I72b55b1f6dfdbd9d08db605308a2ec4456edf858
Signed-off-by: Christian Georgi <christian.georgi@sap.com>
-rw-r--r-- | features/org.eclipse.equinox.executable.feature/library/carbon/eclipseCarbonCommon.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/features/org.eclipse.equinox.executable.feature/library/carbon/eclipseCarbonCommon.c b/features/org.eclipse.equinox.executable.feature/library/carbon/eclipseCarbonCommon.c index 68767328b..75369f148 100644 --- a/features/org.eclipse.equinox.executable.feature/library/carbon/eclipseCarbonCommon.c +++ b/features/org.eclipse.equinox.executable.feature/library/carbon/eclipseCarbonCommon.c @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2008 IBM Corporation and others. + * Copyright (c) 2006, 2015 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -133,8 +133,11 @@ void * loadLibrary( char * library ){ loadVMBundle(library); return (void*) &javaVMBundle; } + _TCHAR *bundle = strdup(library), *start; - if (strstr(bundle, "libjvm") && (start = strstr(bundle, "/Contents/")) != NULL) { + + // check if it's a JVM bundle + if (strstr(bundle, "libjvm") && (start = strstr(bundle, "/Contents/Home/")) != NULL) { start[0] = NULL; loadVMBundle(bundle); free(bundle); @@ -142,6 +145,7 @@ void * loadLibrary( char * library ){ return (void*) &javaVMBundle; } } + free(bundle); void * result= dlopen(library, RTLD_NOW); if(result == 0) |