Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

io.quarkus.test.common.NativeImageLauncher.guessPath() needs to support > Java 9 #7535

Closed
oztimpower opened this issue Mar 3, 2020 · 1 comment · Fixed by #7547
Closed
Labels
kind/enhancement New feature or request
Milestone

Comments

@oztimpower
Copy link
Contributor

The NativeImageLauncher.guessPath() is a method described as a hack to work in IDEs. The code uses URLClassLoader, which has changed to jdk.internal.loader.ClassLoaders$AppClassLoader if using Java11 for example.

(jdk.internal.loader.ClassLoaders$AppClassLoader cannot be cast to class java.net.URLClassLoader (jdk.internal.loader.ClassLoaders$AppClassLoader and java.net.URLClassLoader are in module java.base of loader 'bootstrap'))

Implementation ideas
I hacked guessPath() to look for my Maven "target" folder if it exists as the first check, a reasonable assumption, which did work, which can be done even before it enters the big class loader loop to cater for Gradle et al.

Please add support for the new class loader, plus the directories being checked do not seem to align with the current output folder default for NativeImage which is target/ for Maven.

@oztimpower oztimpower added the kind/enhancement New feature or request label Mar 3, 2020
@gsmet
Copy link
Member

gsmet commented Mar 3, 2020

/cc @jaikiran @stuartwdouglas

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants