Bug 493761: Platform won't launch on Java 9-ea builds
(InjectionException: NoClassDefFoundError:
javax/annotation/PostConstruct)

--add-modules 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 --add-modules argument to the JVM if it
is present in the VM argument list and the JVM version is < 9.

Tested with different builds of Java 8 and Java 9 on Linux, Mac and
Windows. Also tested with both formats of specifying the argument
(one-arg with "=", or two-arg).

Change-Id: I0d4c6ba2ba0e41982a89d7da1aef6c78f276f65c
Signed-off-by: Arun Thondapu <arunkumar.thondapu@in.ibm.com>
5 files changed