A command-line tool to manage multiple Java versions and set JAVA_HOME across different shells and directories.
jEnv is a command-line tool that helps developers manage multiple Java installations on their machines. It allows switching between different Java versions (like Java 8 for Android tools or Java 21 for server apps) and automatically sets the JAVA_HOME environment variable based on the current context. It solves the problem of juggling multiple Java versions across different projects without interfering with system defaults.
Java developers working on projects that require specific Java versions, such as Android app developers needing Java 8 or enterprise developers using modern JVM versions. It's also useful for developers who switch between multiple projects with different Java requirements.
Developers choose jEnv because it's a lightweight, focused tool that does one thing well: managing Java environments without the bloat of installing Java. It integrates seamlessly with shell environments and supports plugins for build tools, making it a reliable alternative to manual JAVA_HOME management or heavier SDK managers.
Manage your Java environment
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Allows precise control with commands like `jenv local 21.0.2`, enabling per-project configuration via `.java-version` files that can be shared in version control.
With the export plugin, jEnv automatically sets JAVA_HOME and JDK_HOME in the shell, eliminating manual profile edits and reducing configuration errors.
Plugins for Gradle, Maven, Ant, Leiningen, and SBT set environment-specific JVM options, streamlining build processes without extra scripting.
Supports bash, zsh, and fish with tailored initialization scripts, making it versatile across different developer setups, though fish support is noted as untested.
jEnv requires users to install Java separately via package managers like Homebrew, unlike all-in-one tools such as SDKMAN, adding an extra step for setup.
The README explicitly states that fish shell integration is 'untested' and may have issues, making it unreliable for developers who rely on fish.
On macOS, setting JAVA_HOME for GUI applications requires running `jenv macos-javahome`, which creates a static file that doesn't update with local or shell version changes.
Installation involves multiple steps: shell initialization, enabling plugins, and adding Java paths, which can be error-prone and confusing for new users.