Skip to content

Disable jre lookup when bundling with why #250

@ykrasik

Description

@ykrasik

I'm submitting a…

  • bug report
  • feature request
  • other

Short description of the issue/suggestion:
Why uses a JRE lookup mechanism where it would search for a compatible JRE in a few places, one of which is the jvm_install specified in launcher.ini. In the case of bundling the jre, it would make sense to turn off this lookup by setting allow_system_java=false, allow_java_location_lookup=false and check_main_class=false in the generated launcher.ini (docs).

Now, this lookup will only run if why can't find a compatible JRE in the specified jvm_install path, however, I encountered a bug where this lookup ran regardless. Probably not a big deal if Why fix their bug, but overall feels like the more correct behavior.

Steps to reproduce the issue/enhancement:

javapackager {
    bundleJre = true
    jrePath = new File(System.properties['java.home'])
    winConfig {
        exeCreationTool = 'why'
    }
}

What is the expected behavior?
Generate a launcher.ini with

allow_system_java=false
allow_java_location_lookup=false

What is the current behavior?
Generates a launcher.ini without the above fields.

Do you have outputs, screenshots, demos or samples which demonstrate the problem or enhancement?

What is the motivation / use case for changing the behavior?
There is no point in allowing why to perform a JRE lookup in the case of bundling a JRE with the app.

Please tell us about your environment:

  • JavaPackager version: 1.6.7
  • OS version: Windows 11
  • JDK version: 1.8.0_271
  • Build tool:
    • Maven
    • Gradle

Other information (e.g. related issues, suggestions how to fix, links for us to have context)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestfixedIssue fixed and release pending

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions