R
Railwayβ€’3y ago
emccue

Specify Java version

How do I customize the java version used to build? The clojure docs imply a .jdk-version can be used, but the Java (maven build) docs don't "Fatal error compiling: error: invalid target release: 19 -> [Help 1]"
28 Replies
Percy
Percyβ€’3y ago
Project ID: fba8052e-ad1b-46b2-8a14-33dce1ed3190
emccue
emccueOPβ€’3y ago
fba8052e-ad1b-46b2-8a14-33dce1ed3190 Follow up will be "how do i run with --enable-preview"
milo
miloβ€’3y ago
not sure what this option does
The clojure docs imply a .jdk-version can be used, but the Java (maven build) docs don't
this is probalby just a docs issue but let me double check
emccue
emccueOPβ€’3y ago
it lets you use features like switch expressions in your code or virtual threads
milo
miloβ€’3y ago
how would you suggest that we know when to use this option for nixpacks
emccue
emccueOPβ€’3y ago
what files do you currently introspect?
milo
miloβ€’3y ago
one sec java is not my level of expertise so please bare with env variable: JDK_VERSION .jdk-version for clojure lemme check for java we only do custom version checks for gradle and you're using maven right @emccue
emccue
emccueOPβ€’3y ago
i am
milo
miloβ€’3y ago
haha that's defo an oversight i presume we can just check the same as the clojure provider .jdk-version seems nix doesnt have older versions of maven
emccue
emccueOPβ€’3y ago
well - you can say like 19-preview implies the flag?
milo
miloβ€’3y ago
as a jdk version that'll automatically imply the flag hmm
emccue
emccueOPβ€’3y ago
could also have a general "jvm startup flags" option
milo
miloβ€’3y ago
yeah maybe
emccue
emccueOPβ€’3y ago
...somewhere
milo
miloβ€’3y ago
we'll just look for -preview versions i usppose
emccue
emccueOPβ€’3y ago
because some preview stuff requires a bit more like to test some incubator features you need to launch the jvm with --add-modules jdk.incubator.feature and to use some old libraries you need to "open" things to reflection manually --add-opens java.base/java.util=ALL_UNNAMED and stuff like that
milo
miloβ€’3y ago
this is why i dont like java let me fix the jdk version bug first
emccue
emccueOPβ€’3y ago
πŸ€·β€β™‚οΈ
milo
miloβ€’3y ago
yeah so turns out it's qute a lot more complicated then this the maven nix package comes with a java version we can't really control it
emccue
emccueOPβ€’3y ago
which sucks, since that java version is hella old kinda the social result of this being the prevailing opinion among the haskell/nix corners of the world i reckon
jr
jrβ€’3y ago
We can override it
milo
miloβ€’3y ago
we can? πŸ™
jr
jrβ€’3y ago
But I don't think jdk19 is available on Nix unfortunatley Yeah we do this for nodejs/yarn
milo
miloβ€’3y ago
oh lord lemme see if i can do smth funky and get it on there i can get it on there but it seems we'll have to update our archive version causing openssl issues so when the openssl issue is fixed i thnik we can upgrade
jr
jrβ€’3y ago
cool cool. I would like to get to that this week (it will not be fun but we do need it)
milo
miloβ€’3y ago
the openssl bug?
jr
jrβ€’3y ago
yeah
milo
miloβ€’3y ago
btw i think upgrading might fix the pcr bug
Want results from more Discord servers?
Add your server