jerryshao opened a new pull request, #11282:
URL: https://github.com/apache/gravitino/pull/11282

   ### What changes were proposed in this pull request?
   
   - Add an explicit Java existence check in `check_java_version()` in 
`bin/common.sh.template` to print a clear error message when `java` is not on 
`PATH` and `JAVA_HOME` is not set, instead of the cryptic `integer expression 
expected` errors.
   - Bump the minimum required Java version from 8 to 17 with a clear error 
message.
   - Replace single-bracket `[ ]` with double-bracket `[[ ]]` for `JVM_VERSION` 
comparisons across all shell script templates (`gravitino.sh`, 
`gravitino-iceberg-rest-server.sh`, `gravitino-lance-rest-server.sh`, 
`gravitino-optimizer.sh`).
   
   ### Why are the changes needed?
   
   When Java is not installed or not on `PATH`, running `gravitino.sh` produces 
confusing errors:
   ```
   common.sh: line 68: [: : integer expression expected
   gravitino.sh: line 154: [: : integer expression expected
   ```
   Users should get a clear, actionable message instead.
   
   Fix: #10330
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes — users running Gravitino with Java older than 17 will now see a clear 
error message instead of a cryptic one.
   
   ### How was this patch tested?
   
   Reproduced the issue locally with `env PATH=/usr/bin:/bin JAVA_HOME="" 
./distribution/package/bin/gravitino.sh status` and verified the fix outputs 
the correct error message.


-- 
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]

Reply via email to