NihalJain commented on code in PR #142: URL: https://github.com/apache/hbase-thirdparty/pull/142#discussion_r2216994170
########## README.md: ########## @@ -92,14 +92,72 @@ modern JDKs. Due to a bug in JDK, we cannot generate this code using a more modern version of the JDK. See [HBASE-26773](https://issues.apache.org/jira/browse/HBASE-26773) for details. +## Jetty 12 and Dual JDK Requirement + +Starting with version 4.1.12, this project requires JDK 8 and JDK 17 to accommodate different HBase versions: + +- **HBase 2.x**: Uses JDK 8 compatible modules (including `hbase-shaded-jetty` with Jetty 9) +- **HBase 3.x**: Uses JDK 17 modules (including `hbase-shaded-jetty-12-plus-*` with Jetty 12) + +### Why Dual JDK Support? + +Jetty 12 requires JDK 17 for compilation, but HBase 2.x deployments cannot move to Jetty 12 for JDK 8 compatibility. Our solution provides a single release containing modules for both JDK versions, eliminating the need for separate branches or releases. + +### Why toolchains are required? +Maven needs explicit toolchain configuration to automatically select JDK 8 for existing modules and JDK 17 for Jetty 12 modules. Environment variables alone are insufficient. + +### Files +- `generate-toolchains.sh` - Script to generate toolchains.xml with configurable paths +- `toolchains.xml` - Generated Maven toolchains configuration file (not checked in) + ## Build/Deploy -To build, make sure that your environment uses JDK8, then just run: +### Local Development Setup + +1. **Install both JDK versions**: JDK 8 and JDK 17 +2. **Set environment variables**: + ```sh + export JAVA8_HOME=/path/to/your/jdk8 + export JAVA17_HOME=/path/to/your/jdk17 + ``` +3. **Choose your toolchain setup approach** (see options below) + +### Toolchain Setup Options + +**Option 1: Project-local toolchains.xml** +```sh +# Generate and use project-specific toolchains +export JAVA8_HOME=/path/to/your/jdk8 +export JAVA17_HOME=/path/to/your/jdk17 +./dev-support/generate-toolchains.sh + +mvn clean install -t toolchains.xml +``` + +**Option 2: Global Maven toolchains setup** +```sh +# Setup toolchains in ~/.m2/ directory +export JAVA8_HOME=/path/to/your/jdk8 +export JAVA17_HOME=/path/to/your/jdk17 +./dev-support/generate-toolchains.sh +cp toolchains.xml ~/.m2/toolchains.xml +mvn clean install +``` + +### CI/Jenkins Setup + +For Jenkins/CI environments, the project auto-detects Java installations at standard paths: Review Comment: update based on implementation/hack! -- 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: issues-unsubscr...@hbase.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org