Skip to content

Commit

Permalink
Check for Java JRE not just a JDK on OS X.
Browse files Browse the repository at this point in the history
Change-Id: I2cb382bb54a2a9f7fba235e643a100a0408233f5
Fixes-Issue: CLIENT-505
Reviewed-on: http://gerrit.dmdirc.com/3396
Automatic-Compile: DMDirc Build Manager
Reviewed-by: Chris Smith <chris@dmdirc.com>
  • Loading branch information
ShaneMcC authored and csmith committed Mar 16, 2014
1 parent 9799f69 commit 9e047f9
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions launcher/unix/DMDirc.sh
Expand Up @@ -23,7 +23,7 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

LAUNCHERVERSION="22"
LAUNCHERVERSION="23"
LAUNCHERINFO="unix-${LAUNCHERVERSION}"

params=""
Expand Down Expand Up @@ -417,8 +417,13 @@ if [ "${ISOSX}" = "1" ]; then
JAVA_HOME=`/usr/libexec/java_home --version 1.7 2>/dev/null`
if [ ${?} -eq 0 -a "" != "${JAVA_HOME}" ]; then
JAVA="${JAVA_HOME}/bin/java"
elif [ -e "/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java" ]; then
# Seems the official JRE doesn't register itself
# properly, and just dumps itself here...
JAVA="/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java"
fi;
fi;
else
if [ -e "${HOME}/.profile" -a "${USEPROFILE}" = "1" ]; then
# Source the profile incase java can't be found otherwise
Expand Down Expand Up @@ -459,7 +464,7 @@ if [ -e "${jar}" ]; then
# Check that DMDirc will run, if java is not 1.7 this will fail.
# We do it this way otherwise segfaults etc would cause an unable to launch
# error message to be printed.
${JAVA} -jar "${jar}" --help >/dev/null 2>&1
"${JAVA}" -jar "${jar}" --help >/dev/null 2>&1
if [ $? -ne 0 ]; then
FAILED=1
# If we are on BSD, check to see if there is alternative versions of java
Expand Down Expand Up @@ -502,7 +507,7 @@ if [ -e "${jar}" ]; then
-Xdock:icon="${jarDir}/../dmdirc.icns"
)
fi;
${JAVA} "${APPLEOPTS[@]}" -Dfile.encoding=utf-8 -ea -jar "${jar}" -l ${LAUNCHERINFO} ${params}
"${JAVA}" "${APPLEOPTS[@]}" -Dfile.encoding=utf-8 -ea -jar "${jar}" -l ${LAUNCHERINFO} ${params}
EXITCODE=${?}
if [ ${EXITCODE} -eq 42 ]; then
# The client says we need to up update, rerun ourself before exiting.
Expand Down

0 comments on commit 9e047f9

Please sign in to comment.