Page MenuHomePhabricator

Java missing from PATH in Clojure buildpack on Toolforge
Open, MediumPublicBUG REPORT

Description

When running a successfully built image for a Clojure application on Toolforge, the application fails to start and the log contains a single entry: bash: line 1: java: command not found

Changing the Procfile for the application to contain an absolute path to the java binary (/app/.jdk/bin/java) fixes the problem.

To replicate

Build and run a Clojure web application, for example version 1.0.4 of the Technical Documentation Dashboard (GitLab repository) on Toolforge.

What happens?:

The application fails to start with the following error: bash: line 1: java: command not found

What should have happened instead?:

The application should start and be available under its URL.

Workaround:

Change the content of the Procfile

From:
web: java -cp target/dashboard-standalone.jar techdoc.dashboard.core

To:
web: /app/.jdk/bin/java -cp target/dashboard-standalone.jar techdoc.dashboard.core

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
fgiunchedi triaged this task as Medium priority.Dec 19 2025, 1:25 PM

I ran into this again. When using --use-latest-versions, the previous workaround (using /app/.jdk/bin/java) no longer works. Using a different path to the Java binary: /workspace/.jdk/bin/java is the current workaround.

I ran into this again. When using --use-latest-versions, the previous workaround (using /app/.jdk/bin/java) no longer works. Using a different path to the Java binary: /workspace/.jdk/bin/java is the current workaround.

The path where it's installed changed to /workspace/.jdk/bin/java.

Oh, I see you already found it :) https://gitlab.wikimedia.org/repos/technical-documentation/techdoc-dashboard/-/blob/develop/Procfile?ref_type=heads

Yes, with the help of #wikimedia-cloud :) It'd still be great to have it in $PATH though!

We might want to upgrade the buildpack, though it's not cloud native, so it needs some adaptation