ammachado opened a new pull request, #24664: URL: https://github.com/apache/camel/pull/24664
# Description First slice of the larger CAMEL-23703 unified Camel CLI package distribution effort, split out for focused review. This branch is **independent** of the other CAMEL-23703 slices and targets `main` directly. It gives the self-contained `camel-launcher` scripts (`bin/camel.sh` and `bin/camel.bat`) a single, shared **Java 17+ runtime discovery contract**. Candidates are evaluated in a fixed order and the first that exists, is executable, and reports a Java major version >= 17 wins: 1. `JAVACMD` (explicit override, unchanged) 2. `$JAVA_HOME/bin/java` (`%JAVA_HOME%\bin\java.exe` on Windows; also honors the SDKMAN `java` candidate) 3. The first `java` (`java.exe`) on `PATH` 4. `CAMEL_FALLBACK_JAVA`, a new variable set by package-manager installs when the JDK location is deterministic Candidates older than 17, missing, non-executable, or with unparseable version output are skipped. If none qualify, the launcher exits nonzero with a diagnostic listing the sources it checked instead of running an unsuitable Java. The obsolete macOS `JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/...` default is removed from `camel.sh`; `JAVA_OPTS` handling is unchanged. Included: the POSIX and Windows-batch discovery contracts, a shared `FakeJava` test harness, behavioral discovery tests for both scripts, and an upgrade-guide note. # Target - [x] I checked that the commit is targeting the correct branch (Camel 4 uses the `main` branch) # Tracking - [x] If this is a large change, bug fix, or code improvement, I checked there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL-23703) filed for the change (usually before you start working on it). # Apache Camel coding standards and style - [x] I checked that each commit in the pull request has a meaningful subject line and body. - [ ] I have run `mvn clean install -DskipTests` locally from root folder and I have committed all auto-generated changes. _`mvn formatter:format impsort:sort` has been applied. A full-repo build verification is still in progress; this PR is intentionally opened as a draft until that completes._ # AI-assisted contributions - [x] If this PR includes AI-generated code, commits have proper co-authorship attribution (e.g., `Co-authored-by` trailers) and the PR description identifies the AI tool used. --- _Claude Code (Opus 4.8) on behalf of ammachado_ -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
