@@ -97,6 +97,7 @@ Build the buildpack binaries:
9797This creates executables in the ` bin/ ` directory:
9898- ` bin/supply ` - Staging phase binary (downloads and installs dependencies)
9999- ` bin/finalize ` - Finalization phase binary (configures runtime)
100+ - ` bin/javaexec ` - Shell-free JVM launcher (tokenizes ` JAVA_OPTS ` without ` eval ` )
100101
101102## Project Structure
102103
@@ -118,6 +119,7 @@ java-buildpack/
118119│ ├── jres/ # JRE implementations (7 providers)
119120│ ├── supply/cli/ # Supply phase entrypoint
120121│ ├── finalize/cli/ # Finalize phase entrypoint
122+ │ ├── javaexec/cli/ # Shell-free JVM launcher entrypoint
121123│ ├── resources/ # Resource configuration files
122124│ └── integration/ # Integration tests
123125├── scripts/ # Build and test scripts
@@ -156,6 +158,7 @@ Build for the default platform (Linux):
156158```
157159-----> Building supply for linux
158160-----> Building finalize for linux
161+ -----> Building javaexec for linux
159162-----> Build complete
160163```
161164
@@ -193,6 +196,25 @@ go build -mod vendor -o bin/supply src/java/supply/cli/main.go
193196
194197# Build finalize
195198go build -mod vendor -o bin/finalize src/java/finalize/cli/main.go
199+
200+ # Build javaexec (shell-free JVM launcher, required at runtime)
201+ go build -mod vendor -o bin/javaexec src/java/javaexec/cli/main.go
202+ ```
203+
204+ ### Source/Git Buildpack Usage
205+
206+ When deploying with a git URL (` cf push -b https://github.com/.../java-buildpack.git ` ),
207+ Cloud Foundry runs ` bin/finalize ` directly from the cloned source. In that mode
208+ ` bin/javaexec ` does not exist (only packaged buildpacks have it). ` bin/finalize `
209+ therefore builds ` javaexec ` into a temp directory alongside the finalize binary
210+ and passes the path via the ` JAVAEXEC_BINARY_PATH ` environment variable.
211+ ` InstallJavaexecLauncher() ` prefers this override and falls back to
212+ ` bin/javaexec ` for packaged buildpacks.
213+
214+ To verify this path locally (no CF required):
215+
216+ ``` bash
217+ bash scripts/test-javaexec-source-path.sh
196218```
197219
198220## Running Tests
0 commit comments