summaryrefslogtreecommitdiff
blob: e7e584fcc60d5b79d9e5aa4e68e1b495266f3b09 (plain)
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
#!/bin/bash
#
# Tiny startup wrapper for Eclipse-3.3
#
# Copyright (c) 2004, Karl Trygve Kalleberg <karltk@gentoo.org>
# Copyright (c) 2007-2008, Jean-Noël Rivasseau <elvanor@gentoo.org>
# Copyright (c) 2004-2008, Gentoo Foundation
#
# Licensed under the GNU General Public License, version 2
#

[[ -f "/etc/eclipserc" ]] && source "/etc/eclipserc"
[[ -f "$HOME/.gentoo/eclipserc" ]] && source "$HOME/.gentoo/eclipserc"

ECLIPSE_HOME=${ECLIPSE_HOME:="/usr/lib/eclipse-3.3"}
ECLIPSE_BIN="${ECLIPSE_HOME}/eclipse"

if [[ ! -x "${ECLIPSE_BIN}" ]] ; then
	echo "Failed to find executable '${ECLIPSE_BIN}'" > /dev/stderr
	exit -1
fi

if ((EUID==0)); then
	echo "!!! You are running Eclipse as root."
	echo "!!! This is not recommended, nor needed."
fi

# get MOZILLA_FIVE_HOME from swt's package.env
# a bit hackish way but works, bug #214785
eval $(gjl --package swt-3 --get-args)

if [[ "${ECLIPSE_XMS}" ]]; then VM_ARGS="${VM_ARGS} -Xms${ECLIPSE_XMS}"; fi
if [[ "${ECLIPSE_XMX}" ]]; then VM_ARGS="${VM_ARGS} -Xmx${ECLIPSE_XMX}"; fi
if [[ "${ECLIPSE_PERMSIZE}" ]]; then VM_ARGS="${VM_ARGS} -XX:PermSize=${ECLIPSE_PERMSIZE}"; fi
if [[ "${ECLIPSE_MAX_PERMSIZE}" ]]; then VM_ARGS="${VM_ARGS} -XX:MaxPermSize=${ECLIPSE_MAX_PERMSIZE}"; fi

exec "${ECLIPSE_BIN}" "$@" -vmargs ${VM_ARGS} -Djava.library.path=/usr/lib