diff --git a/README.md b/README.md index 4997371..4741186 100644 --- a/README.md +++ b/README.md @@ -6,9 +6,32 @@ Automatically change `JAVA_HOME` based on current directory `pom.xml` For now, only Ubuntu and OSX are supported. +### Usage + +```sh +git clone https://github.com/caarlos0/jvm.git ~/.jvm + +# for bash +echo "source ~/.jvm/jvm.sh" >> .bashrc + +# for zsh +echo "source ~/.jvm/jvm.sh" >> .zshrc +``` + +Then, just `cd` to a java project folder. If the `pom.xml` has a +`1.7`, for example, jvm will try to +set JDK7 to your PATH. + +If you don't have and don't want to have this in your project's pom, +you can also do this: + +```sh +echo 7 >> .java-version +``` + + ### TODO - Add support for more platforms (maybe via some config file); - Better documentation; - Tests; -- Maybe use update-java-alternatives on ubuntu and /usr/libexec/java_home on mac