-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
GraalVM polyglot Context is not working in custom JRE(JLink) environment #3339
Comments
Seems like project is missing some modules during jlink - so resulting JRE misses crucial modules to make polyglot context work.
I think I need to add some more modules to make org/graalvm/polyglot/Context work, I just don't know which ones. |
If I change jlinkModules to this:
in runtime I get another exception:
If I add
What really will help me - example of working java application with jlink plugin(maven or gradle). Maybe all problem is that sbt jlink plugin is not suited to build graalvm custom JRE yet. |
@dougxc would you mind taking a look at this advice on what should be done? Thanks |
Using jlink from GraalVM is a known issue: https://bugs.openjdk.java.net/browse/JDK-8237467 |
After lots of experiments, I have a working solution for the problem! Added some modules in the project https://github.com/dkovalenko/play-scala-graalvm-jlink The idea is to build custom JRE with proper modules using GraalVM and then run an application with that JRE and add In this case, GraalVMs jvmci is used and we can have a small JRE size + the ability to use all GraalVMs benefits, including JS engine. |
Describe the issue
I try to bundle my custom graalvm jre using jlink tool.
Error: Hash of java.rmi (bb68a77816d9b03846e06607d7addb24e4ba4dc568898cd97cf21a6547ddfe38) differs to expected hash (31d47a2989873e5fef34bd4481f1bfd864ce36085263a738b2f958244ecccc47) recorded in java.base
Unexpected exception[RuntimeException: java.lang.NoClassDefFoundError: org/graalvm/polyglot/Context]
Steps to reproduce the issue
sbt runProd
Describe GraalVM and your environment:
More details
AdoptOpenJDK 11.0.9.hs: Build ok. Application is working properly.
GraalVM 21.0.0.2.r11: Build error:
Looks similar to this bug: adoptium/aqa-tests#1293
The text was updated successfully, but these errors were encountered: