Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not symmetric fix - what if user chose a different java version?
the logic here is that if you run init with Java 25+ wehter available or chosen we generate for that - if anything it should generate //JAVA but its not something we can do reliably.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But isn't it true that it should be at least Java 25? Otherwise it just won't work, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without
//JAVA 25+the generated code does not run on a system with a default JVM of version 24 or less.If a JVM of version for example 26 is installed, then it will be used to run the script because it matches the JAVA specification of
25+.Maybe not a perfect solution, but it is better than not having
//JAVA 25+.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It also works on java22 with preview flags.
I'm just saying we also don't add java 17 when deps require java 17... Should we ?
I'm not super against it but just saying until now we haven't explicitly added //JAVA unless explicitly user asking for it.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy to abide by what you decide.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
compactSourceFilesis onlytruefor Java 25+Do we have templates that use deps that require Java 17? Then I would say yes we should. But only if we have templates where we have explicitly added those deps. I'm not suggesting we should do any detection or anything. Only straightforward things like have templates or examples where we know the minimum version required.
Until now we haven't used any special Java features in our templates, haven't we? In some of our examples we do, but AFAIK those have //JAVA lines.