Skip to content

Option to set the JAVAHOME before its checked in the bash/bat script. #1070

Closed
@rehan814

Description

@rehan814

Hi,

We want to ship our own jre with the application. The application runs through one of the bash/bat scripts generated by the sbt build tool using universal plugin as universal:package-zip-tarball and universal:packageBin.

Is there any option to check the JAVAHOME before it checks a systemwide JAVAHOME. I mean we want to set our own JAVAHOME through the build.sbt script but that option is added in the bash/bat scripts (specially bat) after it has already check for the systemwide java.

Problem is if the system doesn't have a java then it throws an error to download the java first. In bash script we have suppressed that error using -no-version-check option. But on the bat script there is no such option available.

Expected behaviour

Set JAVAHOME at the start of the bash/bat scripts.

Actual behaviour

javaoptions set through batFileExtraDefines are added at almost end of the batch script when javahome is already been checked.

Information

  • What sbt-native-packager are you using
    universal

  • What sbt version
    0.13.15

  • What is your build system (e.g. Ubuntu, MacOS, Windows, Debian )
    MAcOS

  • What package are you building (e.g. docker, rpm, ...)
    universal package-zip-tarball

  • What version has your build tool (find out with e.g. rpm --version)

  • What is your target system (e.g. Ubuntu 16.04, CentOS 7)
    windows, linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions