#!/bin/sh LWJGL_JLP_OVRD="/usr/local/lib/lwjgl2.9.3" LWJGL_OVRD="/usr/local/share/java/classes/lwjgl/lwjgl.jar" LWJGL_UTIL_OVRD="/usr/local/share/java/classes/lwjgl/lwjgl_util.jar" export JAVA_HOME=/usr/local/openjdk8 build_classpath() { local IFS=":" for p in ${1} do case "${p}" in *lwjgl-*) cp="${cp}:${LWJGL_OVRD}" ;; *lwjgl_util*) cp="${cp}:${LWJGL_UTIL_OVRD}" ;; *) cp="${cp}:${p}" ;; esac done cp=${cp#?} } for var in "${@}" do case "${var}" in -Djava.library*) args="${args} -Djava.library.path=${LWJGL_JLP_OVRD}" ;; *lwjgl_util*) build_classpath "${var}" args="${args} ${cp}" ;; *) args="${args} ${var}" ;; esac done ${JAVA_HOME}/jre/bin/java ${args}