Thanks to visit codestin.com
Credit goes to lib.rs

10 releases

Uses new Rust 2024

0.2.3 Oct 29, 2025
0.2.2 Oct 29, 2025
0.1.4 Aug 31, 2025
0.0.9 Aug 14, 2025
0.0.3 Jul 31, 2025

#553 in Filesystem

Apache-2.0

2MB
41K SLoC

Codestin Search App Codestin Search App Codestin Search App Codestin Search App
Kopi Logo

Kopi - JDK Version Manager

License

Kopi is a JDK version management tool written in Rust that integrates with your shell to seamlessly switch between different Java Development Kit versions.

Full documentation at https://kopi-vm.github.io/

Installation

Homebrew (macOS)

brew install kopi-vm/tap/kopi

PPA (Ubuntu/Debian)

# Import GPG key
curl -fsSL https://keyserver.ubuntu.com/pks/lookup?op=get\&search=0xD2AC04A5A34E9BE3A8B32784F507C6D3DB058848 | \
  gpg --dearmor | \
  sudo tee /usr/share/keyrings/kopi-archive-keyring.gpg > /dev/null

# Add repository
echo "deb [arch=amd64,arm64 signed-by=/usr/share/keyrings/kopi-archive-keyring.gpg] \
  https://kopi-vm.github.io/ppa-kopi $(lsb_release -cs) main" | \
  sudo tee /etc/apt/sources.list.d/kopi.list > /dev/null

# Install
sudo apt update && sudo apt install kopi

Windows Package Manager

winget install kopi

Scoop (Windows)

scoop bucket add kopi https://github.com/kopi-vm/scoop-kopi
scoop install kopi

Cargo (All platforms)

cargo install kopi

Post-installation Setup

# Initial setup
kopi setup

# Add to PATH (in ~/.bashrc, ~/.zshrc, or ~/.config/fish/config.fish)
export PATH="$HOME/.kopi/shims:$PATH"

Quick Start

Essential Commands

# Install JDKs
kopi install 21                    # Latest JDK 21 (Eclipse Temurin by default)
kopi install temurin@17           # Specific distribution and version
kopi install [email protected]     # Exact version

# List installed JDKs
kopi list

# Set versions
kopi global 21                    # Set global default
kopi local 17                     # Set project version (creates .kopi-version)
kopi shell 11                     # Temporary shell override

# Show current JDK
kopi current
kopi which java                   # Path to java executable

# Search available JDKs
kopi search 21                    # Search for JDK 21 variants
kopi search corretto              # List all Corretto versions

# Uninstall JDKs
kopi uninstall temurin@21

Working with Projects

# Create version file for project
cd my-project
kopi local 17                     # Creates .kopi-version

# Kopi automatically switches when entering directories with version files
cd my-java-21-project            # Automatically switches to Java 21
cd my-java-17-project            # Automatically switches to Java 17

Development

Prerequisites

  • Rust toolchain (1.70+)
  • sccache (recommended): cargo install sccache

Building from Source

git clone https://github.com/kopi-vm/kopi.git
cd kopi

# Development build
cargo build

# Run tests
cargo test

# Release build
cargo build --release

Development Workflow

When completing any coding task:

  1. Run cargo fmt to format code
  2. Run cargo clippy --all-targets -- -D warnings to check for improvements
  3. Run cargo test --lib --quiet to run unit tests
  4. Submit a pull request

All commands must pass without errors before considering work complete.

Contributing

We welcome contributions! Please see our Contributing Guidelines for details.

Documentation

License

Kopi is licensed under the Apache License 2.0. See LICENSE for details.

Acknowledgments

  • JDK metadata originally sourced from foojay.io and optimized for fast access
  • Inspired by volta, nvm, and pyenv

Built with ❤️ by the Kopi team

Dependencies

~22–38MB
~595K SLoC