Go to file
2018-10-27 12:00:48 +09:00
bin Fix Oracle license agreement cookie 2018-08-18 12:12:20 -05:00
.travis.yml Cleanup comments and add travis file. 2017-10-14 23:16:50 -05:00
LICENSE Initial commit. 2017-09-21 02:57:35 -05:00
README.md Optimize the script 2018-10-27 12:00:48 +09:00

asdf-java

travis ci Travis Build

Java plugin for the asdf version manager.

Install

After installing asdf, you can add this plugin like this:

asdf plugin-add java

and install new versions like this:

asdf install java oracle-10.0.2

and switch versions like this:

asdf global java oracle-10.0.2

If you want or need JAVA_HOME set you can add this to your shell initialization (in .bashrc, for example):

function asdf_and_update_env() {
  if \asdf "$@"; then
    if [[ "$(\asdf current java 2>&1)" =~ (^([-_.a-zA-Z0-9]+)[[:space:]]*\(set by.*$) ]]; then
      export JAVA_HOME=$(\asdf where java ${BASH_REMATCH[2]})
    else
      export JAVA_HOME=''
    fi
  fi
}

alias asdf='asdf_and_update_env'

If you need Gradle or Maven, you can use asdf plugins for those, too.

asdf plugin-add maven https://github.com/skotchpine/asdf-maven
asdf plugin-add gradle https://github.com/rfrancis/asdf-gradle

Obey

By using this software you agree to:

Reading

Read the asdf readme for instructions on how to install and manage versions of any language.

If you have trouble with any expected features, have any feature requests or want to contribute, please do an issue.

Homage

This plugin wouldn't be possible without the current Java version managers. Here's a list of repos with similar affects that were heavily referenced here:

Development