diff options
Diffstat (limited to 'features/org.eclipse.equinox.executable.feature/library/eclipseNix.c')
-rw-r--r-- | features/org.eclipse.equinox.executable.feature/library/eclipseNix.c | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/features/org.eclipse.equinox.executable.feature/library/eclipseNix.c b/features/org.eclipse.equinox.executable.feature/library/eclipseNix.c index bda8b3cb9..5cfced7a0 100644 --- a/features/org.eclipse.equinox.executable.feature/library/eclipseNix.c +++ b/features/org.eclipse.equinox.executable.feature/library/eclipseNix.c @@ -168,7 +168,8 @@ JavaResults* startJavaVM( _TCHAR* libPath, _TCHAR* vmArgs[], _TCHAR* progArgs[], return startJavaJNI(libPath, vmArgs, progArgs, jarFile); } -int isMaxPermSizeVM( _TCHAR * javaVM, _TCHAR * jniLib ) { +/* returns 1 if the JVM version is >= 9, 0 otherwise */ +int isModularVM( _TCHAR * javaVM, _TCHAR * jniLib ) { if (javaVM == NULL) { return 0; } @@ -194,22 +195,17 @@ int isMaxPermSizeVM( _TCHAR * javaVM, _TCHAR * jniLib ) { version[numChars] = '\0'; } } - if (_tcsstr(buffer, "Java HotSpot(TM)") || _tcsstr(buffer, "OpenJDK")) { - if (version != NULL) { - _TCHAR *value = _tcstok(version, "."); - if (value != NULL && (_tcstol(value, NULL, 10) == 1)) { - value = _tcstok(NULL, "."); - if (_tcstol(value, NULL, 10) < 8) { - result = 1; - } - } + if (version != NULL) { + _TCHAR *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 */ + _TCHAR *majorVersion = _tcstok(str, ".-"); + if (majorVersion != NULL && (_tcstol(majorVersion, NULL, 10) >= 9)) { + result = 1; } - break; - } - if (_tcsstr(buffer, "IBM") != NULL) { - result = 0; - break; + free(version); } + break; } pclose(fp); return result; |