This is an automated email from the ASF dual-hosted git repository.

lhotari pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/pulsar-site.git


The following commit(s) were added to refs/heads/main by this push:
     new 1d9f010e57d6 Add instructions how to setup JDK versions using SDKMAN 
for Pulsar development
1d9f010e57d6 is described below

commit 1d9f010e57d6743df0aecc4ae54acc1efae9f99d
Author: Lari Hotari <[email protected]>
AuthorDate: Mon Oct 14 16:57:56 2024 +0300

    Add instructions how to setup JDK versions using SDKMAN for Pulsar 
development
---
 contribute/release-process.md  | 38 ++-----------------------
 contribute/setup-building.md   |  8 +++---
 contribute/setup-buildtools.md | 63 ++++++++++++++++++++++++++++++++++++++++++
 contribute/setup-ide.md        |  4 +--
 sidebarsDevelopment.js         |  1 +
 5 files changed, 72 insertions(+), 42 deletions(-)

diff --git a/contribute/release-process.md b/contribute/release-process.md
index 2103f7e6d892..96962a99f36b 100644
--- a/contribute/release-process.md
+++ b/contribute/release-process.md
@@ -37,46 +37,12 @@ Before you start the next release steps, make sure you have 
installed these soft
     * Pulsar docker images are running Java 21 since 3.3.0
   * JDK 17 for Pulsar version >= 2.11
   * JDK 11 for earlier versions
-
-Make sure to install the latest stable Amazon Corretto OpenJDK version.
-The recommended installation method is [sdkman](https://sdkman.io/install/).
-
-```shell
-# find out most recent Amazon Corretto release
-sdk l java |grep amzn
-# install
-sdk i java 21.0.4-amzn
-sdk i java 17.0.12-amzn
-# switching between versions
-sdk u java 17.0.12-amzn
-sdk u java 21.0.4-amzn
-# adding aliases
-cd ~/.sdkman/candidates/java
-ln -s 17.0.12-amzn 17
-ln -s 21.0.4-amzn 21
-# switching between versions using aliases
-sdk u java 17
-sdk u java 21
-```
-
-Setting up Java version auto-switching with sdkman so that a `.sdkmanrc` file 
in a directory switches the Java version.
-
-```shell
-# enable sdkman_auto_env
-echo sdkman_auto_env=true >> ~/.sdkman/etc/config
-# ignore .sdkmanrc files by default
-echo .sdkmanrc >> ~/.gitignore_global
-# enable the global ~/.gitignore_global file
-git config --global core.excludesfile $HOME/.gitignore_global
-
-# now you can add .sdkmanrc files to repository directories for automatically 
switching the JDK version
-echo java=21 > .sdkmanrc && cd $PWD
-```
-
 * Maven 3.9.9 (most recent stable Maven 3.9.x version)
   * Install using `sdkman i maven 3.9.9`
 * Zip
 
+Please refer to [setup-buildtools.md](setup-buildtools.md) for details on how 
to install JDKs and Maven using SDKMAN.
+
 ## Set environment variables to be used across the commands {#env-vars}
 
 ```shell
diff --git a/contribute/setup-building.md b/contribute/setup-building.md
index 889ab6ee5f6c..ab6c6de1bc3f 100644
--- a/contribute/setup-building.md
+++ b/contribute/setup-building.md
@@ -8,9 +8,9 @@ title: Setup and building
 | Dependency | Description                                                     
                                                                                
                                                                    |
 
|------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
 | Git        | The source code of Pulsar is hosted on GitHub as a git 
repository. To work with the git repository, please [install 
git](https://git-scm.com/downloads). We highly recommend that you also [set up 
a Git mergetool](setup-git.md#mergetool) for resolving merge conflicts. |
-| JDK        | The source code of Pulsar is primarily written in Java. 
Therefore, you need a working Java Development Kit (JDK) to build it. Pulsar 
requires [JDK 17](https://adoptium.net/temurin/releases/?version=17) to build. |
-| Maven      | The source code of Pulsar is managed by [Apache 
Maven](https://maven.apache.org/) The required Maven version is 3.6.1+.         
                                                                                
    |
-| Zip        | The build process requires Zip as a utility tool.               
                                                                                
                                                                    |
+| JDK        | The source code of Pulsar is primarily written in Java. 
Therefore, you need a working Java Development Kit (JDK) to build it. It 
recommended to use SDKMAN to install Corretto OpenJDK 21 and 17, see ["Setting 
up JDKs and Maven using SDKMAN"](setup-buildtools.md) for details. |
+| Maven      | The source code of Pulsar is managed by [Apache 
Maven](https://maven.apache.org/) The recommended Maven version is 3.9.9. It is 
recommended to use SDKMAN to install Maven, see ["Setting up JDKs and Maven 
using SDKMAN"](setup-buildtools.md) for details. |
+| Zip        | The build process requires Zip as a utility tool. |
 
 :::note
 
@@ -57,4 +57,4 @@ bin/pulsar standalone
 
 ```bash
 bin/pulsar-shell
-```
+```
\ No newline at end of file
diff --git a/contribute/setup-buildtools.md b/contribute/setup-buildtools.md
new file mode 100644
index 000000000000..9f5c68f82d90
--- /dev/null
+++ b/contribute/setup-buildtools.md
@@ -0,0 +1,63 @@
+---
+id: setup-buildtools
+title: Setting up JDKs and Maven using SDKMAN
+---
+
+## Setting up JDKs and Maven using SDKMAN
+
+### Install SDKMAN
+
+See https://sdkman.io/install for detailed instructions.
+
+### Install JDK versions 21 and 17
+
+In Pulsar development, we use [Amazon Corretto 
OpenJDK](https://docs.aws.amazon.com/corretto/) to build Pulsar.
+
+- JDK 21 for Pulsar version >= 3.3
+  - code will be compiled for Java 17 with Java 21
+  - Pulsar docker images are running Java 21 since 3.3.0
+- JDK 17 for Pulsar version >= 2.11
+- JDK 8 or 11 for Pulsar version < 2.11
+
+#### Installing Amazon Corretto OpenJDK versions 21 and 17 using SDKMAN.
+
+```shell
+# find out most recent Amazon Corretto release
+sdk l java |grep amzn
+# install
+sdk i java 21.0.4-amzn
+sdk i java 17.0.12-amzn
+# switching between versions
+sdk u java 17.0.12-amzn
+sdk u java 21.0.4-amzn
+# adding aliases
+cd ~/.sdkman/candidates/java
+ln -s 17.0.12-amzn 17
+ln -s 21.0.4-amzn 21
+# switching between versions using aliases
+sdk u java 17
+sdk u java 21
+```
+
+#### Setting up Java version auto-switching with SDKMAN (optional)
+
+With auto-switching, when there's a `.sdkmanrc` file in a directory, SDKMAN 
will switch to the defined Java version.
+This is convenient for developers to switch between different versions of Java.
+
+```shell
+# enable sdkman_auto_env
+echo sdkman_auto_env=true >> ~/.sdkman/etc/config
+# ignore .sdkmanrc files by default
+echo .sdkmanrc >> ~/.gitignore_global
+# enable the global ~/.gitignore_global file
+git config --global core.excludesfile $HOME/.gitignore_global
+
+# now you can add .sdkmanrc files to repository directories for automatically 
switching the JDK version
+echo java=21 > .sdkmanrc && cd $PWD
+```
+
+### Install Maven
+
+```shell
+sdk i maven 3.9.9
+```
\ No newline at end of file
diff --git a/contribute/setup-ide.md b/contribute/setup-ide.md
index ede4aceb6a00..c37a0f91d763 100644
--- a/contribute/setup-ide.md
+++ b/contribute/setup-ide.md
@@ -10,8 +10,8 @@ Apache Pulsar is using [lombok](https://projectlombok.org/), 
so you have to ensu
 ### Configure Project JDK to JDK 17
 
 1. Open **Project Settings**. Click **File** → **Project Structure** → 
**Project Settings** → **Project**.
-2. Select the JDK version. From the JDK version drop-down list, select 
**Download JDK...** or choose an existing recent Java 17 JDK version.
-3. In the download dialog, select version **17** and vendor **Eclipse Temurin 
(AdoptOpenJDK HotSpot)**.
+2. Select the JDK version. From the JDK version drop-down list, select 
**Download JDK...** or choose an existing recent Java 17 JDK version [installed 
by SDKMAN](setup-buildtools.md).
+3. In the download dialog, select version **17** and vendor **Amazon 
Corretto**.
 
 ### Configure Java version for Maven
 
diff --git a/sidebarsDevelopment.js b/sidebarsDevelopment.js
index 7f03176154e8..90d4513a2985 100644
--- a/sidebarsDevelopment.js
+++ b/sidebarsDevelopment.js
@@ -7,6 +7,7 @@ const sidebars = {
             label: "Getting started",
             items: [
                 'setup-building',
+                'setup-buildtools',
                 'setup-ide',
                 'setup-git',
                 'setup-debugging'

Reply via email to