Files
haikuports/dev-lang/openjdk/sources/java-config.in
Ingo Weinhold 4de4abc407 openjdk: Add some packaging treats
Add to the package:
* bin/java-config: When invoked with option -H it prints the java home
  directory.
* data/profile.d/openjdk.sh: It is automatically sourced by
  /etc/profile and sets JAVA_HOME.
2013-12-06 02:40:58 +01:00

38 lines
387 B
Bash

#!/bin/sh
javaHome="%JAVA_HOME%"
printUsage()
{
cat <<EOF
Usage: java-config <option>
Print java configuration values.
Options:
-h, --help - Print this help text.
-H - Print Java home path.
EOF
}
if [ $# -ne 1 ]; then
printUsage >&2
exit 1
fi
case "$1" in
-H)
echo $javaHome
;;
-h|--help)
printUsage
exit 0
;;
*)
printUsage >&2
exit 1
;;
esac