eclipse / Xpect

This repository has been rewritten to move to the Eclipse Foundation. Find the old history here: https://github.com/TypeFox/Xpect
http://www.xpect-tests.org/
Eclipse Public License 2.0
30 stars 28 forks source link

Xpect files cannot be launched in IDE under Java 9 #264

Closed mor-n4 closed 5 years ago

mor-n4 commented 5 years ago

When using Java 9 or later, Xpect files can no longer be executed in the Eclipse IDE by right-clicking them and selecting Run as / JUnit Test.

The reason for this is that class ClasspathUtil is casting the system class loader to URLClassLoader but as of JDK9 the system class loader is no longer a subtype of that class, cf. https://blog.codefx.org/java/java-9-migration-guide/#Casting-To-URL-Class-Loader.

cdietrich commented 5 years ago

@mor-n4 in Xtext 2.18+ we use https://github.com/classgraph/classgraph for that (orbit is still in the make)

mor-n4 commented 5 years ago

Thanks for the info! I have found another solution that parses system property java.class.path in the same way as the old system class loader did and also the new Java 9 system class loader is still doing (not much code). We could use that as an intermediate fix until we switch Xpect to classgraph.