diff options
author | Arun Thondapu | 2017-05-31 07:14:10 +0000 |
---|---|---|
committer | Arun Thondapu | 2017-05-31 09:56:31 +0000 |
commit | dcd15a168596fb59b04dcb5896252b3429dff115 (patch) | |
tree | 96b9987f6855bac8f2c23633e25cbe191d8207cb /features/org.eclipse.equinox.executable.feature/library/cocoa/eclipseCocoa.c | |
parent | a99892a2d73a61e494bb0bfe06129cec40f9ffc4 (diff) | |
download | rt.equinox.framework-dcd15a168596fb59b04dcb5896252b3429dff115.tar.gz rt.equinox.framework-dcd15a168596fb59b04dcb5896252b3429dff115.tar.xz rt.equinox.framework-dcd15a168596fb59b04dcb5896252b3429dff115.zip |
Bug 517507: Remove Java 9 hacks that were added to the launcher in
Oxygen M7
Revert "Bug 493761: Platform won't launch on Java 9-ea builds
(InjectionException: NoClassDefFoundError:
javax/annotation/PostConstruct)"
This reverts commit 4295e27d8e41283eadba7aa2e098126b22c5a7a9.
This reverts commit 28ff351cfc1b33eb84c70b295e8a86bf8b70d21f.
This reverts commit 2e0869c0e8cf5f4125a3237f22ed6f166a065fbb.
Diffstat (limited to 'features/org.eclipse.equinox.executable.feature/library/cocoa/eclipseCocoa.c')
-rw-r--r-- | features/org.eclipse.equinox.executable.feature/library/cocoa/eclipseCocoa.c | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/features/org.eclipse.equinox.executable.feature/library/cocoa/eclipseCocoa.c b/features/org.eclipse.equinox.executable.feature/library/cocoa/eclipseCocoa.c index 023223103..6bfa9def6 100644 --- a/features/org.eclipse.equinox.executable.feature/library/cocoa/eclipseCocoa.c +++ b/features/org.eclipse.equinox.executable.feature/library/cocoa/eclipseCocoa.c @@ -44,7 +44,7 @@ char *findCommand(char *command); char* defaultVM = "java"; char* vmLibrary = "JavaVM"; char* shippedVMDir = "../../jre/Contents/Home/bin/"; // relative to launcher -int isModularJVM = 0; +int isSunMaxPermSizeVM = 0; static void adjustLibraryPath(char * vmLibrary); static char * findLib(char * command); @@ -330,8 +330,7 @@ char** getArgVM( char* vm ) return result; } -/* set isModularJVM to 1 if the JVM version is >= 9, 0 otherwise */ -void checkJavaVersion(char* command) { +char * getJavaVersion(char* command) { FILE *fp; char buffer[4096]; char *version = NULL, *firstChar; @@ -339,7 +338,7 @@ void checkJavaVersion(char* command) { sprintf(buffer,"%s -version 2>&1", command); fp = popen(buffer, "r"); if (fp == NULL) { - return; + return NULL; } while (fgets(buffer, sizeof(buffer)-1, fp) != NULL) { if (!version) { @@ -355,20 +354,25 @@ void checkJavaVersion(char* command) { version[numChars] = '\0'; } } - if (version != NULL) { - char *str = version; - /* According to the new Java version-string scheme, the first element is - * the major version number, details at http://openjdk.java.net/jeps/223 */ - char *majorVersion = strtok(str, ".-"); - if (majorVersion != NULL && (strtol(majorVersion, NULL, 10) >= 9)) { - isModularJVM = 1; + if (strstr(buffer, "Java HotSpot(TM)") || strstr(buffer, "OpenJDK")) { + if (version != NULL) { + _TCHAR *value = strtok(version, "."); + if (value != NULL && (strtol(value, NULL, 10) == 1)) { + value = strtok(NULL, "."); + if (strtol(value, NULL, 10) < 8) { + isSunMaxPermSizeVM = 1; + } + } } - free(version); + break; + } + if (strstr(buffer, "IBM") != NULL) { + isSunMaxPermSizeVM = 0; + break; } - break; } pclose(fp); - return; + return version; } char * getJavaHome() { @@ -425,8 +429,8 @@ char * findVMLibrary( char* command ) { if (strstr(cmd, "/JavaVM.framework/") != NULL && (strstr(cmd, "/Current/") != NULL || strstr(cmd, "/A/") != NULL)) { cmd = getJavaHome(); } - // This is necessary to initialize isModularJVM - checkJavaVersion(cmd); + // This is necessary to initialize isSunMaxPermSizeVM + getJavaVersion(cmd); result = JAVA_FRAMEWORK; if (strstr(cmd, "/JavaVM.framework/") == NULL) { char * lib = findLib(cmd); @@ -621,8 +625,8 @@ void processVMArgs(char **vmargs[] ) } } -int isModularVM( _TCHAR * javaVM, _TCHAR * jniLib ) { - return isModularJVM; +int isMaxPermSizeVM( _TCHAR * javaVM, _TCHAR * jniLib ) { + return isSunMaxPermSizeVM; } NSString* getApplicationSupport() { |