mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-09 05:10:05 +02:00
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.
38 lines
387 B
Bash
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
|