summaryrefslogtreecommitdiffstats
path: root/java/eclipse/files/eclipse.in
blob: e88d25febc4cc5da2c46f3889a975876aacd7610 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/sh
#
# FreeBSD-specific startup script for Eclipse Platform
#
# See: http://www.eclipse.org
#
# $FreeBSD: ports/java/eclipse/files/eclipse.in,v 1.6 2005/10/18 02:42:04 hq Exp $
#

DEFAULT_JAVA_HOME=%%PREFIX%%
ECLIPSE_HOME=%%ECLIPSE_HOME%%
DEFAULT_JAVA_CMD=java
export MOZILLA_FIVE_HOME=%%LOCALBASE%%/lib/%%BROWSER%%
export LD_LIBRARY_PATH=$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%%" PATH=${JAVA_HOME}/bin:${PATH} exec "${ECLIPSE_HOME}/eclipse" $@