{"id":20406812,"url":"https://github.com/wkgcass/jdkman","last_synced_at":"2026-03-08T06:31:35.702Z","repository":{"id":211214955,"uuid":"728508570","full_name":"wkgcass/jdkman","owner":"wkgcass","description":"Manage multiple JDK instances.","archived":false,"fork":false,"pushed_at":"2024-06-11T08:38:52.000Z","size":221,"stargazers_count":37,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-12T15:08:29.802Z","etag":null,"topics":["command-line-tool","java","native-image"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wkgcass.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-12-07T04:55:35.000Z","updated_at":"2025-03-26T09:44:38.000Z","dependencies_parsed_at":"2024-04-13T04:26:34.748Z","dependency_job_id":"ba3e344a-a3e2-44fc-ba1b-138875c9d78c","html_url":"https://github.com/wkgcass/jdkman","commit_stats":null,"previous_names":["wkgcass/jdkman"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/wkgcass/jdkman","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wkgcass%2Fjdkman","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wkgcass%2Fjdkman/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wkgcass%2Fjdkman/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wkgcass%2Fjdkman/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wkgcass","download_url":"https://codeload.github.com/wkgcass/jdkman/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wkgcass%2Fjdkman/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30247331,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-08T05:41:50.788Z","status":"ssl_error","status_checked_at":"2026-03-08T05:41:39.075Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["command-line-tool","java","native-image"],"created_at":"2024-11-15T05:19:27.860Z","updated_at":"2026-03-08T06:31:35.550Z","avatar_url":"https://github.com/wkgcass.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jdkman\n\n## What is `jdkman`\n\n`jdkman` is a command line tool which helps you manage multiple JDK instances.\n\n[An asciinema cast](https://asciinema.org/a/625934) shows how to use `jdkman`.  \n[This video](https://www.bilibili.com/video/BV1Gu4y137cg/) shows how to configure `jdkman` on Windows.\n\n## How to install\n\n### 1. Download\n\nDownload the pre-built binary from the [release page](https://github.com/wkgcass/jdkman/releases).  \nYou will need to download the binary corresponding to your operating system and cpu architecture.\n\nRename the downloaded file `jdkman-$os-$arch` to `jdkman`  \nYou will also need to run `chmod +x jdkman` on Linux or macOS.\n\n### 2. Configure\n\n#### bash or zsh\n\nAdd the following lines in your `~/.bashrc` or `~/.bash_profile` or `~/.zshrc`\n\n```shell\n## add jdkman to your PATH environment variable.\nexport PATH=\"$PATH:/path/to/jdkman\"\neval \"`jdkman init sh`\"\n```\n\n#### Powershell\n\nAdd `\\path\\to\\jdkman` to your PATH environment variable.\n\nThen configure the profile script by entering the following lines in powershell:\n\n```powershell\necho $profile ## show the profile script location\nNew-Item -ItemType Directory -Path (Split-Path $profile) -Force\n'Invoke-Expression -Command (jdkman init pwsh)' | Out-File -FilePath $profile -Append\n```\n\n#### Windows cmd\n\nSince cmd doesn't support `eval` nor `source`, there's very little that `jdkman` could provide.\n\nAdd `\\path\\to\\jdkman` to your PATH environment variable.  \nAdd `\\YourHomePath\\jdkman-scripts` to your PATH environment variable.\n\nThen in cmd, run once (for each time you upgrades `jdkman`):\n\n```cmd\njdkman init\n```\n\n\u003e You can ignore the init output.\n\n## How to use\n\n### 1. Add JDKs\n\n```shell\njdkman add /Library/Java/JavaVirtualMachines/jdk-21.jdk/Contents/Home\n```\n\n### 2. Show JDKs\n\n```shell\njdkman list\n```\n\n### 3. Set JDK version for each project\n\nAdd a file `.java-version` in the root directory of your project with the following content:\n\n```\n21\n```\n\n`21` could be changed to any JDK versions, e.g. `11`, `11.0.2`, `1.8`.  \n`jdkman` will find the most appropriate JDK version for you.\n\nYou could also specify the `implementor` (or `vendor`) of the JDK:  \nSpecify the vendor name, add a colon, then specify the jdk version:\n\n```\nOracle Corporation:21.0.1+12-29\n```\n\n### 4. Use java\n\n```shell\njava -version\necho $JAVA_HOME\n```\n\n### 5. The `cd` command and `JAVA_HOME`\n\nFor `bash|zsh|powershell`, the `cd` command is replaced with a convenient function: `cdjh`  \nit will `cd` into the specified directory, and configure `JAVA_HOME` environment variable automatically.\n\nYou could also instead explicitly call the `cdjh` function.\n\nNote: This feature is not provided for `cmd`, you have to set it manually by executing the following command:  \n```cmd\nfor /f \"delims=\" %%i in ('jdkman which') do set \"JAVA_HOME=%%i\"\n```\n\n## How to build\n\n### 1. Prerequisites\n\n* JDK 21\n* GraalVM Native Image for JDK 21\n\nTo build `jdkman-proxy`, you will need `rust|cargo`.  \nIt's already built and placed in resource folder, so you can skip `rust`.\n\n### 2. Build\n\n#### Linux or macOS\n\n```shell\n./gradlew clean shadowJar\nnative-image \\\n\t--enable-preview \\\n\t-jar build/libs/jdkman.jar \\\n\t-Ob -march=compatibility \\\n\t--no-fallback \\\n\t-o jdkman\n```\n\n#### Windows (using powershell)\n\n```powershell\n# build `jdkman-proxy`\n$arch=\"x86_64\" # change to aarch64 if running arm windows\ncd .\\src\\main\\rust\\\ncargo build --release\nCopy-Item .\\target\\release\\jdkman-proxy.exe ..\\resources\\io\\vproxy\\jdkman\\res\\jdkman_proxy-windows-$arch.exe\ncd ..\\..\\..\\\n\n# build jdkman\n.\\gradlew.bat clean shadowJar\nnative-image `\n\t--enable-preview `\n\t-jar build\\libs\\jdkman.jar `\n\t--features=io.vproxy.jdkman.res.Feature `\n\t--static `\n\t-Ob -march=compatibility `\n\t--no-fallback `\n\t-o jdkman\n```\n\n#### Linux static image in docker\n\nYou can build a linux static native image using `vproxyio/graalvm-jdk-21`\n\n```shell\ndocker run --name jdkman-build -it -v `pwd`:/workdir vproxyio/graalvm-jdk-21 /bin/bash\n## inside docker\n./gradlew clean shadowJar\nLIBC=\"musl\" ## or glibc\nnative-image \\\n\t--enable-preview \\\n\t-jar build/libs/jdkman.jar \\\n\t--static --libc=$LIBC \\\n\t-Ob -march=compatibility \\\n\t--no-fallback \\\n\t-o jdkman\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwkgcass%2Fjdkman","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwkgcass%2Fjdkman","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwkgcass%2Fjdkman/lists"}