Skip to content

Run extensions in JShell ClassLoader #85

@andrus

Description

@andrus

Currently, Extension implementers are very limited in what they can run directly in the Extension.install(..) method. In particular, they only have access to the kernel ClassLoader, limiting them to pretty much only calling kernel.eval(String), as any custom code referencing external libraries results in ClassNotFoundException.
An ideal behavior would be:

  1. Keep the ability to call kernel.exec(String)
  2. Add the ability to execute any code directly in the install(..) method without converting it to String with full access to JShell classpath

So maybe it is possible to execute extensions in JShell ClassLoader (which seems accessible via JJavaLoaderDelegate)? This would likely require loading (and deduplicating previously loaded) extensions via that ClassLoader.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions