gluonhq / substrate

Create native Java(FX) apps for desktop, mobile and embedded
GNU General Public License v2.0
372 stars 51 forks source link

Couldn't determine GraalVM version #1232

Open westinyang opened 9 months ago

westinyang commented 9 months ago

I just made a try with graalvm 21. I did not work

java.io.IOException: Couldn't determine GraalVM version
    at com.gluonhq.substrate.model.InternalProjectConfiguration.getGraalVersion(InternalProjectConfiguration.java:139)

java -version

java version "21" 2023-09-19
Java(TM) SE Runtime Environment Oracle GraalVM 21+35.1 (build 21+35-jvmci-23.1-b15)
Java HotSpot(TM) 64-Bit Server VM Oracle GraalVM 21+35.1 (build 21+35-jvmci-23.1-b15, mixed mode, sharing)

Same problem: https://github.com/gluonhq/gluonfx-maven-plugin/issues/489

SaptarshiSarkar12 commented 9 months ago

I am also facing the same issue.

Anivie commented 9 months ago

I am find a possible cause is that the regular expression in the fileInternalProjectConfiguration.java was unable to match the new release:

java version "21" 2023-09-19
Java(TM) SE Runtime Environment Oracle GraalVM 21+35.1 (build 21+35-jvmci-23.1-b15)
Java HotSpot(TM) 64-Bit Server VM Oracle GraalVM 21+35.1 (build 21+35-jvmci-23.1-b15, mixed mode, sharing)
SaptarshiSarkar12 commented 9 months ago

@Anivie Yes, the regex does not seem to match the latest version.

credmond commented 8 months ago

Can I ask a question... Anytime I attempt anything other than Gluon's GraalVM build, I get various errors. I always give up in the end. I find substrate would need updates, etc, or there's some other obscure error.

How are you guys getting later GraalVM builds working (apart from 21, which I know is causing you issues)...?

SaptarshiSarkar12 commented 8 months ago

@credmond I have used some configuration in pom.xml file for my Drifty project (A JavaFX app). I am using GitHub Actions to build Drifty for Windows, macOS and Linux. You can check this workflow file for your reference. The workflow automatically sets up Maven version 3.8.8 and installs all the required tools.

SaptarshiSarkar12 commented 8 months ago

Let me know if you want to know anything else.

credmond commented 8 months ago

Thanks. I think what you're doing with missing_symbols.c is key! But you're also setting a lot of other arguments, I will figure out what they're doing and apply to my own... Thank you, this is a good resource!

SaptarshiSarkar12 commented 8 months ago

@credmond Yes, the C file solved some unknown missing method/class failures for windows build, in my case. Happy to help you :smile:! Thank you!

kristofdho commented 8 months ago

As a workaround you can use GraalVM 21.0.1 which was released 2 weeks ago and doesn't trigger the version issue. A caveat though, we're running into an issue where the HomeFinderFeature is not found because substrate adds it to the configuration. I'm having trouble figuring out why this is required in the first place. https://github.com/gluonhq/substrate/blob/992e31eaa517be7df4f136b8d0617cb1748e48fa/src/main/java/com/gluonhq/substrate/target/AbstractTargetConfiguration.java#L77-L78

kkriske commented 8 months ago

I've added a PR to fix the aforementioned additional issues with the HomeFinderFeature, and some additional linker issues on Windows: #1236