hikage/jenv — pull request #29 by ohneda (2013-05-23 09:28:31+00:00)
Title: Can't add JDKs when _JAVA_OPTIONS variable is set

Hi,

I noticed I couldn't add JDKs in my environments which set kind of _JAVA_OPTIONS or JAVA_TOOL variable.

The jenv-add script attempts to get the java version from the first line of output of java -version with head -n 1, but in my case, the first line the command gives out is 'Picked up _JAVA_OPTIONS' not 'java version'.
(and I think the command doesn't guarantee that the 'java version' line will be always printed in in the first line.)

I made a small modification to the jenv-add script in order to use grep instead of head to extract the java version.

Thanks.