jEnv

Manage your Java environment

What's jEnv ?

jEnv is a command line tool to help you forget how to set the JAVA_HOME environment variable

Install jEnv

Linux / OS X

$ git clone https://github.com/jenv/jenv.git ~/.jenv

Mac OS X via Homebrew

$ brew install jenv

Configure your shell

Bash

$ echo 'export PATH="$HOME/.jenv/bin:$PATH"' >> ~/.bash_profile
$ echo 'eval "$(jenv init -)"' >> ~/.bash_profile

Zsh

$ echo 'export PATH="$HOME/.jenv/bin:$PATH"' >> ~/.zshrc
$ echo 'eval "$(jenv init -)"' >> ~/.zshrc

Enable the export plugin

$ eval "$(jenv init -)"
$ jenv enable-plugin export

Restart your shell

$ exec $SHELL -l

Add JDKs/JREs

$ jenv add /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
  oracle64-1.6.0.39 added
$ jenv add /Library/Java/JavaVirtualMachines/jdk17011.jdk/Contents/Home
  oracle64-1.7.0.11 added

And Use !

List managed JDKs

$ jenv versions
  system
  oracle64-1.6.0.39
* oracle64-1.7.0.11 (set by /Users/hikage/.jenv/version)

Configure global version

$ jenv global oracle64-1.6.0.39

Configure local version (per directory)

$ jenv local oracle64-1.6.0.39

Configure shell instance version

$ jenv shell oracle64-1.6.0.39

Contribute

Source code

The project is Open Source and open to external contributions.
Do not hesitate to clone it and propose a pull request.

Report an issue

Did you find a bug? Feature missing in jenv? Create an issue!