export JAVA_HOME in brew invoker

Issue #29 wontfix
Alex Courtis created an issue
#!/bin/bash
JAVA_HOME="${JAVA_HOME:-$(/usr/libexec/java_home --version 1.7+)}" exec "/usr/local/Cellar/mvnvm/1.0.4/libexec/bin/mvn" "$@"

JAVA_HOME should be exported prior to exec, to ensure that it is passed to the subshell.

Comments (3)

  1. Philipp Andronov Account Deactivated

    Im not sure about "$(/usr/libexec/java_home --version 1.7+)}" part as it is not really cross platform. So I would do just export JAVA_HOME to make sure it is environment variable rather then current shel var and thus will be visible for exec

  2. Log in to comment