enso-org / enso

Hybrid visual and textual functional programming.
https://ensoanalytics.com
Apache License 2.0
7.36k stars 324 forks source link

enso --jvm fails with InvalidModuleDescriptorException #11274

Open Akirathan opened 1 week ago

Akirathan commented 1 week ago

Enso built with engine-runner/buildNativeImage fails when given --jvm cmd line opt with:

$ enso --jvm --run tmp.enso
Error occurred during initialization of boot layer
java.lang.module.FindException: Error reading module: /home/pavel/dev/enso/built-distribution/enso-engine-0.0.0-dev-linux-amd64/enso-0.0.0-dev/component/helidon-webclient-websocket-4.0.8.jar
Caused by: java.lang.module.InvalidModuleDescriptorException: Unsupported major.minor version 65.0

Broken with #10823.

### Tasks
- [ ] Fix the `--jvm` cmd line opt for native image
- [ ] Add test that this works on a simple script
Akirathan commented 1 week ago

Works locally on @JaroslavTulach's machine, but not on mine. Probably --jvm does not pick the correct Java version.

JaroslavTulach commented 10 hours ago

Works locally on @JaroslavTulach's machine, but not on mine. Probably --jvm does not pick the correct Java version.

According to the launcher code the --jvm option takes a parameter. Please verify you still see the problems when providing path to the right GraalVM.

JaroslavTulach commented 10 hours ago

If the --jvm option is used without a path, then the code uses distribution manager runtimes to search for a JDK. I cannot say this logic is fully correct. Can we make it better? How? Record JDK version when building native image executable and search/prefer JDK with the same implementation version, then with the same (or newer) specification version, etc.? This is slightly in flux, given the whole NI support isn't yet in production, but having some vision/plan wouldn't hurt.

JaroslavTulach commented 10 hours ago

As a last resort, the system falls back to system java executable. That's probably not a good idea at all. We should:

Pavel, please add the warning and check on your system what's happening. Is it too old system Java?