Skip to content

Conversation

@olpaw
Copy link

@olpaw olpaw commented Oct 8, 2021

@boris-spas this change allows us to use the JLine3Feature when the image-builer runs on module-path.

In this case launcher-common.jar is on the module-path and loaded as module org.graalvm.launcher. In this scenario ClassLoader.getSystemResourceAsStream does not work anymore and we have to use JLine3Feature.class.getModule().getResourceAsStream(resourcePath).

Unfortunately using that directly would break using launcher-common.jar on Java 8. Thus this is instead done reflectivity. On Java 8 we are falling back to using ClassLoader.getSystemResourceAsStream(resourcePath) which is safe because on 8 launcher-common.jar can only ever end up on the classpath.

@olpaw
Copy link
Author

olpaw commented Oct 8, 2021

Btw, I tested that this works with

  • Java 11 with the image-builder
    -- running on module-path
    -- running on classpath
  • Java 8 with image-builer (on classpath, obviously)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant