View | Details | Raw Unified | Return to bug 96050
Collapse All | Expand All

(-)javavmwrapper/src/javavm.1 (+6 lines)
Lines 124-129 Link Here
124
.Ql 1.5
124
.Ql 1.5
125
and
125
and
126
.Ql 1.5+ .
126
.Ql 1.5+ .
127
.It Ev JAVAVM_PRINT_JAVA_HOME
128
When set, find the best suitable JVM and print the corresponding value of
129
JAVA_HOME instead of executing the java program.
130
.It Ev JAVAVM_PRINT_JAVA_PROGRAM
131
When set, find the best suitable JVM and print the path of the Java program
132
instead of executing it.
127
.El
133
.El
128
.Sh FILES
134
.Sh FILES
129
.Bl -tag -width indent
135
.Bl -tag -width indent
(-)javavmwrapper/src/javavmwrapper.sh (-5 / +17 lines)
Lines 6-11 Link Here
6
# They can then be selected from based on environment variables and the
6
# They can then be selected from based on environment variables and the
7
# configuration file.
7
# configuration file.
8
#
8
#
9
# Please have a look at the javavm(1) man page for more information.
10
#
9
# ----------------------------------------------------------------------------
11
# ----------------------------------------------------------------------------
10
# "THE BEER-WARE LICENSE" (Revision 42, (c) Poul-Henning Kamp):
12
# "THE BEER-WARE LICENSE" (Revision 42, (c) Poul-Henning Kamp):
11
# Maxim Sobolev <sobomax@FreeBSD.org> wrote this file.  As long as you retain
13
# Maxim Sobolev <sobomax@FreeBSD.org> wrote this file.  As long as you retain
Lines 43-55 Link Here
43
tryJavaCommand () {
45
tryJavaCommand () {
44
    # Check for the command being executable and exec it if so.
46
    # Check for the command being executable and exec it if so.
45
    if [ -x "${1}" ]; then
47
    if [ -x "${1}" ]; then
46
        if [ ! -z "${SAVE_PATH}" ]; then
48
        if [ -z "$JAVAVM_PRINT_JAVA_HOME" -a -z "$JAVAVM_PRINT_JAVA_PROGRAM" ] ; then
47
            export PATH=${SAVE_PATH}
49
            if [ ! -z "${SAVE_PATH}" ]; then
50
                export PATH=${SAVE_PATH}
51
            fi
52
53
            exec "${@}"
54
            echo "${IAM}: error: couldn't run specified Java command - \"${1}\"" >&2
55
            exit 1
56
        else
57
            if [ -n "$JAVAVM_PRINT_JAVA_HOME" ] ; then
58
                echo "${JAVA_HOME}"
59
            else
60
                echo "${@}"
61
            fi
62
            exit 0
48
        fi
63
        fi
49
        exec "${@}"
50
    fi
64
    fi
51
52
    echo "${IAM}: warning: couldn't run specified Java command - \"${1}\"" >&2
53
}
65
}
54
66
55
#
67
#

Return to bug 96050