As a general intuition check, should I forget about classpath as a runtime concern in GraalVM-compiled programs? For example, when reading from the filesystem, should I prefer calling slurp directly over io/resource? Does classpath serve any purpose at runtime?
@coby Classpath still works for io/resource but you have to explicity configure your build to keep resources around in your image
Note that these regexes are classpath resource paths, not file system paths
Another example, this time in babashka: https://github.com/babashka/babashka/blob/ead237eee335fc3bc4cdfc88e3fb4af821878b3c/resources/META-INF/native-image/babashka/babashka/native-image.properties#L5-L8
But if I don't know ahead of time where the config file would live (say it's a CLI option on the binary itself) then I would not be able to use resource in this way, correct?
yes, but this is also true of regular JVM programs
That's what I thought, just wanted to confirm. Thanks! 🙂
btw I found your Hello World GraalVM video extremely helpful, so thanks for that too.
Cool!