Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArun Thondapu2017-05-03 11:10:10 -0400
committerArun Thondapu2017-05-03 11:10:10 -0400
commit4295e27d8e41283eadba7aa2e098126b22c5a7a9 (patch)
tree4dbf323db22639f5d1a332191b7285b1e3e2d8d1 /features
parent8b412e84f744a3dd4a10259afb94a9875fdf2750 (diff)
downloadrt.equinox.framework-4295e27d8e41283eadba7aa2e098126b22c5a7a9.tar.gz
rt.equinox.framework-4295e27d8e41283eadba7aa2e098126b22c5a7a9.tar.xz
rt.equinox.framework-4295e27d8e41283eadba7aa2e098126b22c5a7a9.zip
Bug 493761: Platform won't launch on Java 9-ea builds
(InjectionException: NoClassDefFoundError: javax/annotation/PostConstruct) --permit-illegal-access VM argument is needed to run eclipse with Java 9 but Java 8 does not recognize this argument and fails to start up. This patch prevents passing the --permit-illegal-access argument to the JVM if it is present in the VM argument list and the JVM version is < 9. Change-Id: Id39176a1e4f092d59063111667dd738a0b951ad4 Signed-off-by: Arun Thondapu <arunkumar.thondapu@in.ibm.com>
Diffstat (limited to 'features')
-rw-r--r--features/org.eclipse.equinox.executable.feature/library/eclipse.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/features/org.eclipse.equinox.executable.feature/library/eclipse.c b/features/org.eclipse.equinox.executable.feature/library/eclipse.c
index d65cfb2fc..e927af2c9 100644
--- a/features/org.eclipse.equinox.executable.feature/library/eclipse.c
+++ b/features/org.eclipse.equinox.executable.feature/library/eclipse.c
@@ -251,6 +251,7 @@ home directory.");
#define XXPERMGEN _T_ECLIPSE("-XX:MaxPermSize=")
#define ADDMODULES _T_ECLIPSE("--add-modules")
+#define PERMIT_ILLEGAL_ACCESS _T_ECLIPSE("--permit-illegal-access")
#define ACTION_OPENFILE _T_ECLIPSE("openFile")
#define GTK_VERSION _T_ECLIPSE("--launcher.GTK_version")
@@ -1041,7 +1042,7 @@ static void adjustVMArgs(_TCHAR *javaVM, _TCHAR *jniLib, _TCHAR **vmArgv[]) {
if (!isModularVM(javaVM, jniLib)) {
while ((*vmArgv)[i] != NULL) {
- if (_tcsncmp((*vmArgv)[i], ADDMODULES, _tcslen(ADDMODULES)) == 0) {
+ if (_tcsncmp((*vmArgv)[i], ADDMODULES, _tcslen(ADDMODULES)) == 0 || _tcsncmp((*vmArgv)[i], PERMIT_ILLEGAL_ACCESS, _tcslen(PERMIT_ILLEGAL_ACCESS)) == 0) {
int j = 0, k = 0;
if ((_tcschr((*vmArgv)[i], '=') != NULL) && ((*vmArgv)[i][13] == '=')) {
@@ -1050,6 +1051,9 @@ static void adjustVMArgs(_TCHAR *javaVM, _TCHAR *jniLib, _TCHAR **vmArgv[]) {
} else if (_tcslen(ADDMODULES) == _tcslen((*vmArgv)[i])) {
/* --add-modules <value> OR --add-modules <end-of-vmArgv> */
((*vmArgv)[i + 1] != NULL) ? (j = i + 2) : (j = i + 1);
+ } else if (_tcslen(PERMIT_ILLEGAL_ACCESS) == _tcslen((*vmArgv)[i])) {
+ /* --permit-illegal-access */
+ j = i + 1;
} else {
/* Probable new argument e.g. --add-modules-if-required or misspelled argument e.g. --add-modulesq */
i++;

Back to the top