aboutsummaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
authorGreg Lewis <glewis@FreeBSD.org>2006-06-12 16:57:29 +0000
committerGreg Lewis <glewis@FreeBSD.org>2006-06-12 16:57:29 +0000
commit7fdb2af1ba801649b25c4e26e30165c0af968ef9 (patch)
tree60f2931022dd36b1512cbd7d419b4a4221ffddf2 /java
parent32907f0dac95d40de190cf88adcccca43adf51b9 (diff)
downloadports-7fdb2af1ba801649b25c4e26e30165c0af968ef9.tar.gz
ports-7fdb2af1ba801649b25c4e26e30165c0af968ef9.zip
Notes
Diffstat (limited to 'java')
-rw-r--r--java/javavmwrapper/Makefile9
-rw-r--r--java/javavmwrapper/pkg-plist3
-rw-r--r--java/javavmwrapper/src/javavmwrapper.sh385
-rw-r--r--java/javavmwrapper/src/manvm.1140
4 files changed, 362 insertions, 175 deletions
diff --git a/java/javavmwrapper/Makefile b/java/javavmwrapper/Makefile
index 41532e62693f..04781fe684c2 100644
--- a/java/javavmwrapper/Makefile
+++ b/java/javavmwrapper/Makefile
@@ -8,7 +8,7 @@
#
PORTNAME= javavmwrapper
-PORTVERSION= 2.2
+PORTVERSION= 2.3
CATEGORIES= java
MASTER_SITES= # none
DISTFILES= # none
@@ -23,7 +23,7 @@ NO_WRKSUBDIR= yes
PKGINSTALL= ${WRKDIR}/pkg-install
-MAN1= checkvms.1 javavm.1 registervm.1 unregistervm.1
+MAN1= checkvms.1 javavm.1 manvm.1 registervm.1 unregistervm.1
MAN5= javavm_opts.conf.5 javavms.5
SRC= ${.CURDIR}/src
@@ -43,7 +43,7 @@ do-configure:
.endfor
${SED} -e 's|%%LOCALBASE%%|${LOCALBASE}|;' \
${FILESDIR}/pkg-install.in > ${PKGINSTALL}
-.for _man in checkvms.1 javavm.1 registervm.1 ${MAN5}
+.for _man in checkvms.1 javavm.1 manvm.1 registervm.1 ${MAN5}
${SED} -e 's|%%PREFIX%%|${PREFIX}|;' \
-e 's|%%LOCALBASE%%|${LOCALBASE}|;' \
-e 's|%%PORTSDIR%%|${PORTSDIR}|;' \
@@ -56,7 +56,8 @@ do-install:
${LN} -sf ${PREFIX}/bin/javavm ${PREFIX}/bin/registervm
${LN} -sf ${PREFIX}/bin/javavm ${PREFIX}/bin/unregistervm
${LN} -sf ${PREFIX}/bin/javavm ${PREFIX}/bin/checkvms
-.for _man in checkvms.1 javavm.1 registervm.1
+ ${LN} -sf ${PREFIX}/bin/javavm ${PREFIX}/bin/manvm
+.for _man in checkvms.1 javavm.1 manvm.1 registervm.1
${INSTALL_MAN} ${WRKDIR}/${_man} ${MAN1PREFIX}/man/man1
.endfor
${INSTALL_MAN} ${WRKDIR}/registervm.1 \
diff --git a/java/javavmwrapper/pkg-plist b/java/javavmwrapper/pkg-plist
index 9ff1c2eb4999..254d0559d91a 100644
--- a/java/javavmwrapper/pkg-plist
+++ b/java/javavmwrapper/pkg-plist
@@ -1,6 +1,7 @@
+bin/checkvms
bin/classpath
bin/javavm
+bin/manvm
bin/registervm
bin/unregistervm
-bin/checkvms
etc/javavm_opts.conf.dist
diff --git a/java/javavmwrapper/src/javavmwrapper.sh b/java/javavmwrapper/src/javavmwrapper.sh
index 6881172e731b..4d9bb90d83dd 100644
--- a/java/javavmwrapper/src/javavmwrapper.sh
+++ b/java/javavmwrapper/src/javavmwrapper.sh
@@ -44,12 +44,12 @@ _JAVAVM_MAKE=/usr/bin/make
tryJavaCommand () {
# If this is a test run, spit out the configuration and exit
if [ -n "${JAVAVM_DRYRUN}" ]; then
- echo "JAVA_HOME=${JAVA_HOME}"
- echo "JAVAVM_CONF=${_JAVAVM_CONF}"
- echo "JAVAVM_OPTS_CONF=${_JAVAVM_OPTS_CONF}"
- echo "JAVAVM_PROG=${1}"
- echo "JAVAVM_OPTS=${_JAVAVM_OPTS}"
- echo "JAVAVM_COMMAND=${@}"
+ echo "JAVA_HOME=${JAVA_HOME}"
+ echo "JAVAVM_CONF=${_JAVAVM_CONF}"
+ echo "JAVAVM_OPTS_CONF=${_JAVAVM_OPTS_CONF}"
+ echo "JAVAVM_PROG=${1}"
+ echo "JAVAVM_OPTS=${_JAVAVM_OPTS}"
+ echo "JAVAVM_COMMAND=${@}"
exit 0
fi
@@ -61,7 +61,7 @@ tryJavaCommand () {
exec "${@}"
fi
- echo "${_JAVAVM_PROG}: warning: couldn't run specified Java command - \"${1}\"" >&2
+ echo "${_JAVAVM_PROG}: warning: couldn't run specified Java command - \"${1}\"" 1>&2
}
#
@@ -120,7 +120,7 @@ sortConfiguration () {
# Ensure the configuration file has the correct permissions
if [ ! -w "${_JAVAVM_CONF}" -o ! -r "${_JAVAVM_CONF}" ]; then
- echo "${_JAVAVM_PROG}: error: can't read/write ${_JAVAVM_CONF} configuration file!" >&2
+ echo "${_JAVAVM_PROG}: error: can't read/write ${_JAVAVM_CONF} configuration file!" 1>&2
return
fi
@@ -374,13 +374,13 @@ unregisterVM () {
# Check for the configuration file
if [ ! -e "${_JAVAVM_CONF}" ]; then
- echo "${_JAVAVM_PROG}: error: can't find ${_JAVAVM_CONF} configuration file!" >&2
+ echo "${_JAVAVM_PROG}: error: can't find ${_JAVAVM_CONF} configuration file!" 1>&2
exit 1
fi
# Ensure the configuration file has the correct permissions
if [ ! -w "${_JAVAVM_CONF}" -o ! -r "${_JAVAVM_CONF}" ]; then
- echo "${_JAVAVM_PROG}: error: can't read/write ${_JAVAVM_CONF} configuration file!" >&2
+ echo "${_JAVAVM_PROG}: error: can't read/write ${_JAVAVM_CONF} configuration file!" 1>&2
exit 1
fi
@@ -430,6 +430,198 @@ EOF
exit 0
}
+#
+# Show the manual page for a Java VM
+#
+manualpageVM () {
+ # Check usage
+ if [ -z "${1}" ]; then
+ echo "Usage: ${_JAVAVM_PROG} name"
+ exit 1
+ fi
+
+ # Look for an appropriate JAVA_HOME
+ _JAVAVM_SAVE_PROG=${_JAVAVM_PROG}
+ _JAVAVM_PROG="../man/man1/${1}.1"
+ setJavaHome
+ if [ $? != 0 ]; then
+ echo "${_JAVAVM_SAVE_PROG}: error: no suitable JavaVMs found" 1>&2
+ exit 1
+ fi
+
+ # Run man(1)
+ MANPATH="${JAVA_HOME}/man:${MANPATH}"
+ export MANPATH
+ setJavaOptions man "`basename ${JAVA_HOME}`"
+ exec man -S 1 ${_JAVAVM_OPTS} ${1}
+}
+
+#
+# Set up an appropriate JAVA_HOME
+#
+setJavaHome() {
+ # Use JAVA_HOME if it's set, unless its set to %%PREFIX%%
+ if [ -n "${JAVA_HOME}" -a \
+ "`realpath "${JAVA_HOME}"`" != "`realpath "${_JAVAVM_PREFIX}"`" ]; then
+ if [ -n "${JAVA_HOME}" -a -f "${JAVA_HOME}/bin/${_JAVAVM_PROG}" ]; then
+ _JAVAVM_PROG_PATH="${JAVA_HOME}/bin"
+ return 0
+ elif [ -n "${JAVA_HOME}" -a \
+ -f "${JAVA_HOME}/jre/bin/${_JAVAVM_PROG}" ]; then
+ _JAVAVM_PROG_PATH="${JAVA_HOME}/jre/bin"
+ return 0
+ fi
+ fi
+
+ unset JAVA_HOME
+
+ # Determine location of bsd.port.mk if it exists
+ _JAVAVM_PORTSDIR=
+ if [ -r /usr/share/mk/bsd.port.mk ]; then
+ _JAVAVM_PORTSDIR=`"${_JAVAVM_MAKE}" -f /usr/share/mk/bsd.port.mk -V PORTSDIR 2>/dev/null`
+ fi
+
+ _JAVAVM_BSD_PORT_MK=
+ if [ -n "${_JAVAVM_PORTSDIR}" -a -r "${_JAVAVM_PORTSDIR}/Mk/bsd.port.mk" ]; then
+ _JAVAVM_BSD_PORT_MK="${_JAVAVM_PORTSDIR}/Mk/bsd.port.mk"
+ fi
+
+ # If bsd.port.mk was found, use that to determine the VM to use.
+ if [ -n "${_JAVAVM_BSD_PORT_MK}" ]; then
+ JAVA_HOME=`"${_JAVAVM_MAKE}" -f "${_JAVAVM_BSD_PORT_MK}" -V JAVA_HOME USE_JAVA=yes 2>/dev/null`
+ if [ -n "${JAVA_HOME}" -a -f "${JAVA_HOME}/bin/${_JAVAVM_PROG}" ]; then
+ _JAVAVM_PROG_PATH="${JAVA_HOME}/bin"
+ return 0
+ elif [ -n "${JAVA_HOME}" -a \
+ -f "${JAVA_HOME}/jre/bin/${_JAVAVM_PROG}" ]; then
+ _JAVAVM_PROG_PATH="${JAVA_HOME}/jre/bin"
+ return 0
+ fi
+ fi
+
+ # Then try to make sure that ${_JAVAVM_CONF} exists
+ if [ ! -e "${_JAVAVM_CONF}" ]; then
+ echo "${_JAVAVM_PROG}: error: can't find ${_JAVAVM_CONF} configuration file" 1>&2
+ exit 1
+ fi
+
+ # Allow comments in the ${_JAVAVM_CONF}
+ _JAVAVM_VMS=`sed -E 's|[[:space:]]*#.*||' < "${_JAVAVM_CONF}" | uniq 2>/dev/null`
+
+ # Fix up JAVA_VERSION
+ if [ -n "${JAVA_VERSION}" ]; then
+ _JAVAVM_VERSION=
+ for version in ${JAVA_VERSION}; do
+ case "${version}" in
+ 1.1+)
+ _JAVAVM_VERSION="${_JAVAVM_VERSION} 1.1 1.2 1.3 1.4 1.5"
+ ;;
+ 1.2+)
+ _JAVAVM_VERSION="${_JAVAVM_VERSION} 1.2 1.3 1.4 1.5"
+ ;;
+ 1.3+)
+ _JAVAVM_VERSION="${_JAVAVM_VERSION} 1.3 1.4 1.5"
+ ;;
+ 1.4+)
+ _JAVAVM_VERSION="${_JAVAVM_VERSION} 1.4 1.5"
+ ;;
+ 1.5+)
+ _JAVAVM_VERSION="${_JAVAVM_VERSION} 1.5"
+ ;;
+ *)
+ _JAVAVM_VERSION="${_JAVAVM_VERSION} ${version}"
+ ;;
+ esac
+ done
+ JAVA_VERSION=`echo "${_JAVAVM_VERSION}" | sort | uniq`
+ fi
+
+ # Finally try to run one of the ${_JAVAVM_VMS}
+ for _JAVAVM_JAVAVM in ${_JAVAVM_VMS}; do
+ JAVA_HOME=`dirname "${_JAVAVM_JAVAVM}"`
+ JAVA_HOME=`dirname "${JAVA_HOME}"`
+ _JAVAVM_VM=`basename "${JAVA_HOME}"`
+ # Respect JAVA_VERSION
+ if [ -n "${JAVA_VERSION}" ]; then
+ _JAVAVM_VERSION=`echo ${_JAVAVM_VM} | \
+ sed -e 's|[^0-9]*\([0-9]\)\.\([0-9]\)\.[0-9]|\1.\2|'`
+ for _JAVAVM_REQUESTED_VERSION in ${JAVA_VERSION}; do
+ if [ "${_JAVAVM_VERSION}" = "${_JAVAVM_REQUESTED_VERSION}" ]; then
+ _JAVAVM_VERSION=
+ break
+ fi
+ done
+ if [ -n "${_JAVAVM_VERSION}" ]; then
+ continue
+ fi
+ fi
+ # Respect JAVA_OS
+ if [ -n "${JAVA_OS}" ]; then
+ _JAVAVM_OS=
+ case "${_JAVAVM_VM}" in
+ diablo*|j*)
+ _JAVAVM_OS=native
+ ;;
+ linux*)
+ _JAVAVM_OS=linux
+ ;;
+ esac
+ for _JAVAVM_REQUESTED_OS in ${JAVA_OS}; do
+ if [ "${_JAVAVM_OS}" = "${_JAVAVM_REQUESTED_OS}" ]; then
+ _JAVAVM_OS=
+ break
+ fi
+ done
+ if [ -n "${_JAVAVM_OS}" ]; then
+ continue
+ fi
+ fi
+ # Respect JAVA_VENDOR
+ if [ -n "${JAVA_VENDOR}" ]; then
+ _JAVAVM_VENDOR=
+ case "${_JAVAVM_VM}" in
+ diablo*)
+ _JAVAVM_VENDOR=bsdjava
+ ;;
+ j*)
+ _JAVAVM_VENDOR=freebsd
+ ;;
+ linux-blackdown*)
+ _JAVAVM_VENDOR=blackdown
+ ;;
+ linux-ibm*)
+ _JAVAVM_VENDOR=ibm
+ ;;
+ linux-sun*)
+ _JAVAVM_VENDOR=sun
+ ;;
+ esac
+ for _JAVAVM_REQUESTED_VENDOR in ${JAVA_VENDOR}; do
+ if [ "${_JAVAVM_VENDOR}" = "${_JAVAVM_REQUESTED_VENDOR}" ]; then
+ _JAVAVM_VENDOR=
+ break
+ fi
+ done
+ if [ -n "${_JAVAVM_VENDOR}" ]; then
+ continue
+ fi
+ fi
+ # Check if the command exists
+ if [ -n "${JAVA_HOME}" -a -f "${JAVA_HOME}/bin/${_JAVAVM_PROG}" ]; then
+ _JAVAVM_PROG_PATH="${JAVA_HOME}/bin"
+ return 0
+ elif [ -n "${JAVA_HOME}" -a \
+ -f "${JAVA_HOME}/jre/bin/${_JAVAVM_PROG}" ]; then
+ _JAVAVM_PROG_PATH="${JAVA_HOME}/jre/bin"
+ return 0
+ fi
+ done
+
+ unset JAVA_HOME
+
+ return 1
+}
+
# Check for an alias and call the appropriate function.
case "${_JAVAVM_PROG}" in
registervm )
@@ -441,6 +633,9 @@ case "${_JAVAVM_PROG}" in
checkvms )
checkVMs
;;
+ manvm )
+ manualpageVM "${1}"
+ ;;
esac
# Main ()
@@ -457,169 +652,19 @@ if [ -r "${_JAVAVM_OPTS_CONF}" ]; then
fi
_JAVAVM_OPTS=
-# Ignore JAVA_HOME if it's set to %%PREFIX%%
-if [ "`realpath "${JAVA_HOME}"`" != "`realpath "${_JAVAVM_PREFIX}"`" ]; then
- # Otherwise use JAVA_HOME if it's set
- if [ -n "${JAVA_HOME}" -a -x "${JAVA_HOME}/bin/${_JAVAVM_PROG}" ]; then
- setJavaOptions "${_JAVAVM_PROG}" "`basename ${JAVA_HOME}`"
- export JAVA_HOME
- tryJavaCommand "${JAVA_HOME}/bin/${_JAVAVM_PROG}" ${_JAVAVM_OPTS} "${@}"
- elif [ -n "${JAVA_HOME}" -a -x "${JAVA_HOME}/jre/bin/${_JAVAVM_PROG}" ]; then
- setJavaOptions "${_JAVAVM_PROG}" "`basename ${JAVA_HOME}`"
- export JAVA_HOME
- tryJavaCommand "${JAVA_HOME}/jre/bin/${_JAVAVM_PROG}" ${_JAVAVM_OPTS} "${@}"
- fi
-fi
-
-unset JAVA_HOME
-
-# Determine location of bsd.port.mk if it exists
-_JAVAVM_PORTSDIR=
-if [ -r /usr/share/mk/bsd.port.mk ]; then
- _JAVAVM_PORTSDIR=`"${_JAVAVM_MAKE}" -f /usr/share/mk/bsd.port.mk -V PORTSDIR 2>/dev/null`
-fi
-
-_JAVAVM_BSD_PORT_MK=
-if [ -n "${_JAVAVM_PORTSDIR}" -a -r "${_JAVAVM_PORTSDIR}/Mk/bsd.port.mk" ]; then
- _JAVAVM_BSD_PORT_MK="${_JAVAVM_PORTSDIR}/Mk/bsd.port.mk"
-fi
-
-# If bsd.port.mk was found, use that to determine the VM to use.
-if [ -n "${_JAVAVM_BSD_PORT_MK}" ]; then
- JAVA_HOME=`"${_JAVAVM_MAKE}" -f "${_JAVAVM_BSD_PORT_MK}" -V JAVA_HOME USE_JAVA=yes 2>/dev/null`
- if [ -n "${JAVA_HOME}" -a \
- -x "${JAVA_HOME}/bin/${_JAVAVM_PROG}" ]; then
- setJavaOptions "${_JAVAVM_PROG}" "`basename ${JAVA_HOME}`"
- export JAVA_HOME
- tryJavaCommand "${JAVA_HOME}/bin/${_JAVAVM_PROG}" ${_JAVAVM_OPTS} "${@}"
- elif [ -n "${JAVA_HOME}" -a \
- -x "${JAVA_HOME}/jre/bin/${_JAVAVM_PROG}" ]; then
- setJavaOptions "${_JAVAVM_PROG}" "`basename ${JAVA_HOME}`"
- export JAVA_HOME
- tryJavaCommand "${JAVA_HOME}/jre/bin/${_JAVAVM_PROG}" ${_JAVAVM_OPTS} "${@}"
- fi
-fi
-
-# Then try to make sure that ${_JAVAVM_CONF} exists
-if [ ! -e "${_JAVAVM_CONF}" ]; then
- echo "${_JAVAVM_PROG}: error: can't find ${_JAVAVM_CONF} configuration file" >&2
+# Determine JAVA_HOME
+setJavaHome
+if [ $? != 0 ]; then
+ echo "${_JAVAVM_PROG}: error: no suitable JavaVMs found" 1>&2
exit 1
fi
-# Allow comments in the ${_JAVAVM_CONF}
-_JAVAVM_VMS=`sed -E 's|[[:space:]]*#.*||' < "${_JAVAVM_CONF}" | uniq 2>/dev/null`
-
-# Fix up JAVA_VERSION
-if [ -n "${JAVA_VERSION}" ]; then
- _JAVAVM_VERSION=
- for version in ${JAVA_VERSION}; do
- case "${version}" in
- 1.1+)
- _JAVAVM_VERSION="${_JAVAVM_VERSION} 1.1 1.2 1.3 1.4 1.5"
- ;;
- 1.2+)
- _JAVAVM_VERSION="${_JAVAVM_VERSION} 1.2 1.3 1.4 1.5"
- ;;
- 1.3+)
- _JAVAVM_VERSION="${_JAVAVM_VERSION} 1.3 1.4 1.5"
- ;;
- 1.4+)
- _JAVAVM_VERSION="${_JAVAVM_VERSION} 1.4 1.5"
- ;;
- 1.5+)
- _JAVAVM_VERSION="${_JAVAVM_VERSION} 1.5"
- ;;
- *)
- _JAVAVM_VERSION="${_JAVAVM_VERSION} ${version}"
- ;;
- esac
- done
- JAVA_VERSION=`echo "${_JAVAVM_VERSION}" | sort | uniq`
+# Set up the options and run the command
+if [ -x "${_JAVAVM_PROG_PATH}/${_JAVAVM_PROG}" ]; then
+ setJavaOptions "${_JAVAVM_PROG}" "`basename ${JAVA_HOME}`"
+ export JAVA_HOME
+ tryJavaCommand "${_JAVAVM_PROG_PATH}/${_JAVAVM_PROG}" ${_JAVAVM_OPTS} "${@}"
fi
-# Finally try to run one of the ${_JAVAVM_VMS}
-for _JAVAVM_JAVAVM in ${_JAVAVM_VMS}; do
- JAVA_HOME=`dirname "${_JAVAVM_JAVAVM}"`
- JAVA_HOME=`dirname "${JAVA_HOME}"`
- _JAVAVM_VM=`basename "${JAVA_HOME}"`
- # Respect JAVA_VERSION
- if [ -n "${JAVA_VERSION}" ]; then
- _JAVAVM_VERSION=`echo ${_JAVAVM_VM} | \
- sed -e 's|[^0-9]*\([0-9]\)\.\([0-9]\)\.[0-9]|\1.\2|'`
- for _JAVAVM_REQUESTED_VERSION in ${JAVA_VERSION}; do
- if [ "${_JAVAVM_VERSION}" = "${_JAVAVM_REQUESTED_VERSION}" ]; then
- _JAVAVM_VERSION=
- break
- fi
- done
- if [ -n "${_JAVAVM_VERSION}" ]; then
- continue
- fi
- fi
- # Respect JAVA_OS
- if [ -n "${JAVA_OS}" ]; then
- _JAVAVM_OS=
- case "${_JAVAVM_VM}" in
- diablo*|j*)
- _JAVAVM_OS=native
- ;;
- linux*)
- _JAVAVM_OS=linux
- ;;
- esac
- for _JAVAVM_REQUESTED_OS in ${JAVA_OS}; do
- if [ "${_JAVAVM_OS}" = "${_JAVAVM_REQUESTED_OS}" ]; then
- _JAVAVM_OS=
- break
- fi
- done
- if [ -n "${_JAVAVM_OS}" ]; then
- continue
- fi
- fi
- # Respect JAVA_VENDOR
- if [ -n "${JAVA_VENDOR}" ]; then
- _JAVAVM_VENDOR=
- case "${_JAVAVM_VM}" in
- diablo*)
- _JAVAVM_VENDOR=bsdjava
- ;;
- j*)
- _JAVAVM_VENDOR=freebsd
- ;;
- linux-blackdown*)
- _JAVAVM_VENDOR=blackdown
- ;;
- linux-ibm*)
- _JAVAVM_VENDOR=ibm
- ;;
- linux-sun*)
- _JAVAVM_VENDOR=sun
- ;;
- esac
- for _JAVAVM_REQUESTED_VENDOR in ${JAVA_VENDOR}; do
- if [ "${_JAVAVM_VENDOR}" = "${_JAVAVM_REQUESTED_VENDOR}" ]; then
- _JAVAVM_VENDOR=
- break
- fi
- done
- if [ -n "${_JAVAVM_VENDOR}" ]; then
- continue
- fi
- fi
- # Check if the command exists and try to run it.
- if [ -n "${JAVA_HOME}" -a \
- -x "${JAVA_HOME}/bin/${_JAVAVM_PROG}" ]; then
- setJavaOptions "${_JAVAVM_PROG}" "`basename ${JAVA_HOME}`"
- export JAVA_HOME
- tryJavaCommand "${JAVA_HOME}/bin/${_JAVAVM_PROG}" ${_JAVAVM_OPTS} "${@}"
- elif [ -n "${JAVA_HOME}" -a \
- -x "${JAVA_HOME}/jre/bin/${_JAVAVM_PROG}" ]; then
- setJavaOptions "${_JAVAVM_PROG}" "`basename ${JAVA_HOME}`"
- export JAVA_HOME
- tryJavaCommand "${JAVA_HOME}/jre/bin/${_JAVAVM_PROG}" ${_JAVAVM_OPTS} "${@}"
- fi
-done
-
-echo "${_JAVAVM_PROG}: error: no suitable JavaVMs found" >&2
+echo "${_JAVAVM_PROG}: error: no suitable JavaVMs found" 1>&2
exit 1
diff --git a/java/javavmwrapper/src/manvm.1 b/java/javavmwrapper/src/manvm.1
new file mode 100644
index 000000000000..c4a900cb83c9
--- /dev/null
+++ b/java/javavmwrapper/src/manvm.1
@@ -0,0 +1,140 @@
+.\"
+.\" Copyright (C) 2006 Greg Lewis. All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd June 12, 2006
+.Os
+.Dt MANVM 1
+.Sh NAME
+.Nm manvm
+.Nd format and display the on-line Java VM manual pages
+.Sh SYNOPSIS
+.Nm
+.Op Ar name
+.Sh DESCRIPTION
+.Nm Manvm
+provides a convenient system for displaying the on-line manual pages
+for different Java VMs without having to add their (conflicting) manual
+page directories to
+.Ev MANPATH
+.Pp
+By default,
+.Nm
+will select the most
+.Dq native
+and up to date version of the Java VM when locating the manual page to
+be displayed.
+This selection process is akin to that used by
+.Nm javavm
+in that the same environment variables and processes are used.
+.Pp
+The manual pages are displayed using
+.Nm man ,
+and all applicable environment variables, save for
+.Ev MANPATH ,
+are respected.
+Options may be passed to
+.Nm man
+using the
+.Ev JAVAVM_OPTS
+environment variable and its associated sub-variables and configuration
+file.
+.Sh ENVIRONMENT
+.Bl -tag -width indent
+.It Ev JAVA_HOME
+The presence of this variable in the environment when executing
+.Nm
+will override all other considerations regarding the Java VM whose on-line
+manual pages will be displayed and the manual pages located at
+.Pa ${JAVA_HOME}/man
+will be used.
+.Pp
+.It Ev JAVA_OS
+A space delimited list of operating systems.
+The on-line manual pages to be displayed must come from a Java VM that has
+been created for one of the operating systems in the list.
+.Pp
+Currently allowed operating system values are
+.Ql native
+and
+.Ql linux .
+.It Ev JAVA_VENDOR
+A space delimited list of Java VM vendors.
+The on-line manual pages to be displayed must come from a Java VM that has
+been released by one of the vendors in the list.
+.Pp
+Currently allowed vendors are
+.Ql bsdjava ,
+.Ql freebsd ,
+.Ql blackdown ,
+.Ql ibm
+and
+.Ql sun .
+.It Ev JAVA_VERSION
+A space delimited list of versions of the Java VM from which the on-line
+manual pages may come.
+By appending a
+.Ql +
+to a version, the on-line manual pages from any Java VM with a version
+greater than or equal to the given version will be used.
+.Pp
+Currently allowed versions are
+.Ql 1.1 ,
+.Ql 1.1+ ,
+.Ql 1.2 ,
+.Ql 1.2+ ,
+.Ql 1.3 ,
+.Ql 1.3+ ,
+.Ql 1.4 ,
+.Ql 1.4+ ,
+.Ql 1.5
+and
+.Ql 1.5+ .
+.It Ev JAVAVM_OPTS
+The contents of this environment variable will be passed to the invoked
+.Nm man
+as options.
+For more information on environment variables which can be used to set
+options see
+.Pa %%PREFIX%%/etc/javavm_opts.conf.dist .
+.El
+.Sh EXAMPLES
+.Bl -tag -width indent
+.It Pa %%LOCALBASE%%/bin/manvm java
+Display the on-line manual page for the
+.Nm java
+programme of the the most up to date and
+.Dq native
+Java VM registered with
+.Nm javavm .
+.It Ev JAVA_VERSION=1.5 Pa %%LOCALBASE%%/bin/manvm javac
+Display the on-line manual page for the
+.Nm javac
+programme for a Java VM which is version 1.5.
+.El
+.Sh SEE ALSO
+.Xr javavm 1 ,
+.Xr man 1 ,
+.Xr javavm_opts.conf 5