Skip to content

Can jdk version be left alone if the JAVA directive is omitted? #139

@sixcorners

Description

@sixcorners

Is your feature request related to a problem? Please describe.
I'm always frustrated when I get java 11 when I omit a //JAVA directive.

Describe the solution you'd like
I want jbang to leave the project's jdk version alone when the script has no //JAVA directive... or let me set a different version to default to.

Describe alternatives you've considered
Currently I delete all jdks that are not 25 out of IntelliJ so it has no choice but to use my 25 jdk. I could also set a //JAVA version but I don't want to.

Additional context

val javaVersion = if (javaSdkVersion != null) {
(19 downTo 9).firstOrNull { javaSdkVersion.contains("${it}.0") } ?: 8
} else {
11
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions