Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArun Thondapu2017-05-31 07:14:10 +0000
committerArun Thondapu2017-05-31 09:56:31 +0000
commitdcd15a168596fb59b04dcb5896252b3429dff115 (patch)
tree96b9987f6855bac8f2c23633e25cbe191d8207cb /features/org.eclipse.equinox.executable.feature/library/win32/eclipseWin.c
parenta99892a2d73a61e494bb0bfe06129cec40f9ffc4 (diff)
downloadrt.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/win32/eclipseWin.c')
-rw-r--r--features/org.eclipse.equinox.executable.feature/library/win32/eclipseWin.c31
1 files changed, 22 insertions, 9 deletions
diff --git a/features/org.eclipse.equinox.executable.feature/library/win32/eclipseWin.c b/features/org.eclipse.equinox.executable.feature/library/win32/eclipseWin.c
index 73a394344..4df9e99dd 100644
--- a/features/org.eclipse.equinox.executable.feature/library/win32/eclipseWin.c
+++ b/features/org.eclipse.equinox.executable.feature/library/win32/eclipseWin.c
@@ -77,7 +77,10 @@ typedef struct {
WORD codepage;
} TRANSLATIONS;
+#define COMPANY_NAME_KEY _T_ECLIPSE("\\StringFileInfo\\%04x%04x\\CompanyName")
#define PRODUCT_VERSION_KEY _T_ECLIPSE("\\StringFileInfo\\%04x%04x\\ProductVersion")
+#define SUN_MICROSYSTEMS _T_ECLIPSE("Sun Microsystems")
+#define ORACLE _T_ECLIPSE("Oracle")
static void sendOpenFileMessage(HWND window) {
_TCHAR* id;
@@ -597,16 +600,16 @@ JavaResults* startJavaVM( _TCHAR* libPath, _TCHAR* vmArgs[], _TCHAR* progArgs[],
return startJavaJNI(libPath, vmArgs, progArgs, jarFile);
}
-/* returns 1 if the JVM version is >= 9, 0 otherwise */
-int isModularVM( _TCHAR * javaVM, _TCHAR * jniLib ) {
+int isMaxPermSizeVM( _TCHAR * javaVM, _TCHAR * jniLib ) {
_TCHAR *vm = (jniLib != NULL) ? jniLib : javaVM;
int result = 0;
DWORD infoSize;
DWORD handle;
void * info;
- _TCHAR *versionKey, *version, *majorVersion = NULL;
- int versionSize;
+ _TCHAR *key, *value, *versionKey, *version, *majorVersion = NULL;
+ size_t i;
+ int valueSize, versionSize;
if (vm == NULL)
return 0;
@@ -620,15 +623,25 @@ int isModularVM( _TCHAR * javaVM, _TCHAR * jniLib ) {
VerQueryValue(info, _T_ECLIPSE("\\VarFileInfo\\Translation"), (void *) &translations, &translationsSize);
/* this size is only right because %04x is 4 characters */
+ key = malloc((_tcslen(COMPANY_NAME_KEY) + 1) * sizeof(_TCHAR));
versionKey = malloc((_tcslen(PRODUCT_VERSION_KEY) + 1) * sizeof(_TCHAR));
- _stprintf(versionKey, PRODUCT_VERSION_KEY, translations[0].language, translations[0].codepage);
- VerQueryValue(info, versionKey, (void *)&version, &versionSize);
- if (versionSize >= 1) {
- majorVersion = _tcstok(version, ".-");
- if ((majorVersion != NULL) && (_tcstol(majorVersion, NULL, 10) >= 9)) {
+ for (i = 0; i < (translationsSize / sizeof(TRANSLATIONS)); i++) {
+ _stprintf(key, COMPANY_NAME_KEY, translations[i].language, translations[i].codepage);
+ VerQueryValue(info, key, (void *)&value, &valueSize);
+
+ if ((_tcsncmp(value, SUN_MICROSYSTEMS, _tcslen(SUN_MICROSYSTEMS)) == 0) || (_tcsncmp(value, ORACLE, _tcslen(ORACLE)) == 0)) {
+ _stprintf(versionKey, PRODUCT_VERSION_KEY, translations[i].language, translations[i].codepage);
+ VerQueryValue(info, versionKey, (void *)&version, &versionSize);
+ if (versionSize > 1) {
+ majorVersion = _tcstok(version, ".");
+ }
+ if ((majorVersion != NULL) && (_tcstol(majorVersion, NULL, 10) < 8)) {
result = 1;
}
+ break;
}
+ }
+ free(key);
free(versionKey);
}
free(info);

Back to the top