r1953 - in trunk/eclipse/debian: . extra
Michael Koch
mkoch at costa.debian.org
Mon Feb 27 21:27:02 UTC 2006
Author: mkoch
Date: 2006-02-27 21:26:59 +0000 (Mon, 27 Feb 2006)
New Revision: 1953
Modified:
trunk/eclipse/debian/changelog
trunk/eclipse/debian/extra/efj.sh
Log:
* debian/extra/efj.sh: Rewritten to match the code from eclipse.sh
Closes: #353555
Modified: trunk/eclipse/debian/changelog
===================================================================
--- trunk/eclipse/debian/changelog 2006-02-26 16:31:09 UTC (rev 1952)
+++ trunk/eclipse/debian/changelog 2006-02-27 21:26:59 UTC (rev 1953)
@@ -8,6 +8,8 @@
* control.in, eclipse-rcp-common.install, eclipse-rcp.install,
extra/arch-files.txt, libswt3.1-gtk-java.install: Moved
org.eclipse.swt plugins to eclipse-rcp package.
+ * debian/extra/efj.sh: Rewritten to match the code from eclipse.sh
+ Closes: #353555
[ Matthias Klose ]
* debian/control.in: eclipse replaces eclipse-platform (<< 3.1.2-2).
@@ -16,7 +18,7 @@
* debian/rules: Set a default for MOZILLA_HOME.
* Set JAVA_HOME for the build (needed for non-matching gcc/gcj versions).
- -- Michael Koch <konqueror at gmx.de> Thu, 16 Feb 2006 08:52:25 +0000
+ -- Michael Koch <konqueror at gmx.de> Mon, 27 Feb 2006 11:11:20 +0000
eclipse (3.1.2-1) unstable; urgency=low
Modified: trunk/eclipse/debian/extra/efj.sh
===================================================================
--- trunk/eclipse/debian/extra/efj.sh 2006-02-26 16:31:09 UTC (rev 1952)
+++ trunk/eclipse/debian/extra/efj.sh 2006-02-27 21:26:59 UTC (rev 1953)
@@ -1,13 +1,128 @@
#!/bin/bash
-source /usr/share/java-common/java-common.sh
-JAVA_HOME=`jvm_find ecj`
+# Having any sort of classpath causes massive breakage, with Kaffe at least.
+unset CLASSPATH; export CLASSPATH
-if [ -z "$JAVA_HOME" ]; then
- echo "Could not find a suitable JVM." >&2
+# Allow the user to specify their own Java home, we check for it later.
+#unset JAVA_HOME; export JAVA_HOME
+
+CMDLINEARGS=""
+VMARGS=""
+INSTALL="/usr/share/eclipse"
+STARTUP="/usr/share/eclipse/startup.jar"
+
+if [ -x /usr/bin/zenity ]; then
+ DIALOG=/usr/bin/zenity
+elif [ -x /usr/bin/kdialog ]; then
+ DIALOG=/usr/bin/kdialog
+elif [ -x /usr/bin/xdialog ]; then
+ DIALOG=/usr/bin/xdialog
+else
+ DIALOG=echo
+fi
+
+# Make sure this directory exists.
+if [ ! -d ~/.eclipse ]; then
+ mkdir ~/.eclipse > /dev/null 2>&1
+ if [ $? -ne 0 ]; then
+ $DIALOG \
+ --error \
+ --title="Could not launch Eclipse Platform" \
+ --text="Could not create settings directory at ~/.eclipse."
+ fi
+fi
+
+# Just in case Eclipse tries to put something in the home directory.
+cd ~
+
+# Load default settings from the user's configuration file.
+if [ -f ~/.eclipse/eclipserc ]; then
+ source ~/.eclipse/eclipserc
+fi
+
+# Process the command line options. These override the eclipserc file, so we do
+# them after parsing that file.
+while [ "$1" ]; do
+ if [ "$1" = "-h" -o "$1" = "--help" ]; then
+ echo "Eclipse Starter Script"
+ echo "Usage:"
+ echo "eclipse [options [value]]"
+ echo "See eclipse(1) for more information."
+ echo ""
+ echo "Also see ~/.eclipse/eclipserc, which provides some default values"
+ exit 0
+ elif [ "$1" = "-vm" ]; then
+ shift
+ unset JAVA_HOME
+ JAVACMD="$1"
+ shift
+ elif [ "$1" = "-install" ]; then
+ shift
+ INSTALL="$1"
+ shift
+ elif [ "$1" = "-startup" ]; then
+ shift
+ STARTUP="$1"
+ shift
+ elif [ "$1" = "-vmargs" ]; then
+ shift
+ while [ "$1" ]; do
+ VMARGS="${VMARGS} $1"
+ shift
+ done
+ else
+ CMDLINEARGS="${CMDLINEARGS} $1"
+ shift
+ fi
+done
+
+# If the user has specified a custom JAVA, we check it for validity.
+# JAVA defines the virtual machine that Eclipse will use to launch itself.
+if [ -n "${JAVA_HOME}" ]; then
+ echo "using specified vm: ${JAVA_HOME}"
+ if [ ! -x "${JAVA_HOME}/bin/java" ]; then
+ $DIALOG \
+ --error \
+ --title="Could not launch Eclipse Platform" \
+ --text="The custom VM you have chosen is not a valid executable."
+ exit 1
+ fi
+fi
+
+# If the user has not set JAVA_HOME, cycle through our list of compatible VM's
+# and pick the first one that exists.
+if [ -z "${JAVA_HOME}" -a ! -n "${JAVACMD}" ]; then
+ echo "searching for compatible vm..."
+ javahomelist=`cat /etc/eclipse/java_home | grep -v '^#' | grep -v '^$' | while read line ; do echo -n $line ; echo -n ":" ; done`
+ OFS="$IFS"
+ IFS=":"
+ for JAVA_HOME in $javahomelist ; do
+ echo -n " testing ${JAVA_HOME}..."
+ if [ -x "${JAVA_HOME}/bin/java" ]; then
+ export JAVA_HOME
+ echo "found"
+ break
+ else
+ echo "not found"
+ fi
+ done
+ IFS="$OFS"
+fi
+
+# If we don't have a JAVA_HOME yet, we're doomed.
+if [ -z "${JAVA_HOME}" -a ! -n "${JAVACMD}" ]; then
+ $DIALOG \
+ --error \
+ --title="Could not launch Eclipse Platform" \
+ --text="A suitable Java Virtual Machine for running the Eclipse Platform could not be located."
exit 1
fi
+# Set JAVACMD from JAVA_HOME
+if [ -n "${JAVA_HOME}" -a -z "${JAVACMD}" ]; then
+ JAVACMD="$JAVA_HOME/bin/java"
+fi
+
case $CLASSPATH in
*/usr/share/eclipse/startup.jar*) ;;
*) CLASSPATH=$CLASSPATH:/usr/share/eclipse/startup.jar
@@ -15,7 +130,12 @@
export CLASSPATH
+# Do the actual launch of the Eclipse Code Formatter with the selected VM.
exec $JAVA_HOME/bin/java \
org.eclipse.core.launcher.Main \
-application org.eclipse.jdt.core.JavaCodeFormatter \
- ${1+"$@"}
+ ${1+"$@"} \
+ -vmargs -Djava.library.path=/usr/lib/jni \
+ -Dgnu.gcj.precompiled.db.path=/var/lib/gcj-4.0/classmap.db \
+ -Dgnu.gcj.runtime.VMClassLoader.library_control=never \
+ -Dosgi.locking=none ${VMARGS}
More information about the pkg-java-commits
mailing list