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

Support to modify Java classpath at run-time #2693

Closed
drianpauL opened this issue Jul 21, 2022 · 1 comment
Closed

Support to modify Java classpath at run-time #2693

drianpauL opened this issue Jul 21, 2022 · 1 comment
Assignees

Comments

@drianpauL
Copy link

From: https://graalvm.slack.com/archives/CMY63522F/p1658321203861729

When running TruffleRuby in JVM mode (--jvm), it would be nice to have a convenient method modify the JVM classpath at run-time.

An example use case for this would be for a Ruby gem (managed via Bundler) that loads a Java library. Currently users of that gem would need to supply additional environment or command-line options at start time: e.g. --vm.classpath=/graalvm/languages/ruby/lib/gems/gems/some-ruby-gem-1.0.0/some-java-lib.jar (in addition to specifying the gem version in a Gemfile) . It would be much more convenient if the Ruby gem could update the classpath itself when it was loaded.


NB: @woess and @eregon mentioned that GraalJS has a built-in function: Java.addToClasspath
https://github.com/oracle/graaljs/blob/3e4d6a7520ed514c756242a6618357138499576c/graal-js/src/com.oracle.truffle.js/src/com/oracle/truffle/js/builtins/JavaBuiltins.java#L656-L678

@eregon eregon added this to the 22.3.0 milestone Jul 21, 2022
graalvmbot pushed a commit that referenced this issue Jul 25, 2022
@bjfish
Copy link
Contributor

bjfish commented Jul 25, 2022

@drianpauL This is now added at 925274f. Thank you for reporting this.

@bjfish bjfish closed this as completed Jul 25, 2022
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

No branches or pull requests

3 participants