ports/java/eclipse/files/eclipse.in
Greg Lewis 6602230e32 . Force eclipse to use one of the jdk* ports rather than the diablo-jdk15
port on FreeBSD 7.x and higher as mixing the native 7.x libraries of
  eclipse and the native 6.x libraries of diablo-jdk is a recipe for trouble.

PR:		118115
2008-01-17 07:51:46 +00:00

49 lines
1.3 KiB
Bash

#!/bin/sh
#
# FreeBSD-specific startup script for Eclipse Platform
#
# See: http://www.eclipse.org
#
# $FreeBSD$
#
DEFAULT_JAVA_HOME=%%PREFIX%%
ECLIPSE_HOME=%%ECLIPSE_HOME%%
DEFAULT_JAVA_CMD=java
MOZILLA_FIVE_HOME=%%LOCALBASE%%/lib/%%BROWSER%%
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MOZILLA_FIVE_HOME
export MOZILLA_FIVE_HOME LD_LIBRARY_PATH
#-----------------------------------------------------------------------------
# Determine configuration settings
#-----------------------------------------------------------------------------
# Determine the JDK home directory
if [ -z "${JAVA_HOME}" ]; then
JAVA_HOME=${DEFAULT_JAVA_HOME}
fi
# Determine 'java' executable
if [ -z "${JAVACMD}" ]; then
if [ -n "${JAVA_HOME}" ]; then
JAVACMD="${JAVA_HOME}/bin/java"
else
JAVACMD=${DEFAULT_JAVACMD}
fi
fi
# Check if 'java' executable can be found
if [ ! -x "$JAVACMD" ]; then
echo "Error: JAVA_HOME is not defined correctly: ${JAVA_HOME}"
echo " Unable to find ${JAVACMD}"
exit 1
fi
# Check if 'eclipse' executable can be found
if [ ! -x "${ECLIPSE_HOME}/eclipse" ]; then
echo "Error: ECLIPSE_HOME is not defined correctly: ${ECLIPSE_HOME}"
echo " Unable to find eclipse launcher binary"
exit 1
fi
JAVA_VERSION="%%JAVA_VERSION%%" JAVA_OS="%%JAVA_OS%%" %%JAVA_VENDOR_SPECIFICATION%% PATH=${JAVA_HOME}/bin:${PATH} exec "${ECLIPSE_HOME}/eclipse" $@