Skip to content

JBP_CONFIG_JAVA_MAIN java_main_class and arguments not supported #1267

Closed

Description

@stokpop

The Go buildpack ignores java_main_class and arguments from JBP_CONFIG_JAVA_MAIN.

java_main_class

JBP_CONFIG_JAVA_MAIN: '{java_main_class: org.springframework.boot.loader.launch.PropertiesLauncher}'

Should override the manifest Main-Class and switch to classpath mode (-cp). Currently has no effect.

arguments

JBP_CONFIG_JAVA_MAIN: '{arguments: "--custom.arg=value"}'

Should append arguments after the main class. Currently has no effect.

Both are supported in the Ruby buildpack via config/java_main.yml.

Activity

  1. changed the title [-]Java Main: JBP_CONFIG_JAVA_MAIN java_main_class and arguments not supported[/-] [+]JBP_CONFIG_JAVA_MAIN java_main_class and arguments not supported[/+] on May 11, 2026
  2. stokpop commented on May 11, 2026

    @stokpop
    ContributorAuthor

    Additional fix added in this PR: when java_main_class is set, the registry now short-circuits before the normal container detection order, so it correctly overrides higher-priority containers like Spring Boot.

    Previously, a Spring Boot app would be detected as Spring Boot before JavaMainContainer.Detect() was ever called, so JBP_CONFIG_JAVA_MAIN had no effect even with the initial fix.

    Also added Ruby parity: when java_main_class is one of the Spring Boot launchers (JarLauncher, PropertiesLauncher, WarLauncher), SERVER_PORT=$PORT is now written to profile.d — matching the Ruby buildpack behaviour.

    Example:

    JBP_CONFIG_JAVA_MAIN: '{java_main_class: "org.springframework.boot.loader.launch.PropertiesLauncher", arguments: "--loader.home=/home/vcap/data"}'

    Branch: issue-1267-fix-jbp-config-java-main (stokpop fork)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions