Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using Ubuntu 11.04 and once installed Eclipse 3.5.2 via software center. Now I plan to make an upgrade to 4.1, so I downloaded the *.tar.gz file from here. I replaced the contents in /usr/lib/eclipse and now it's time to modify the start-up script /usr/bin/eclipse, which I am not familiar with, such as the dependency and the setting, coded in the file. Can anyone tell me how to rewrite those parts? Thank you.

The script is as follows:


# work around for e#290395 / LP: #458703

export MOZILLA_FIVE_HOME="/usr/lib/xulrunner-$(/usr/bin/xulrunner-1.9.2--gre-version)"


    if [ ! -e "$1" ] ; then
    echo "W: Cannot find $1" 2>&1
    return 1
    cat - >>"$1" <<EOF
Update Site


if [ ! -d ~/.eclipse/ ] ; then
    $ECLIPSE -clean -initialize || exit $?
    if [ ! -d "$settings" ] ; then
    echo "W: Cannot inject update-sites, cannot find the correct config." 2>&1
    ( inject_update_site
"$settings/org.eclipse.equinox.p2.metadata.repository.prefs" && \
"$settings/org.eclipse.equinox.p2.artifact.repository.prefs" && \
      echo "I: Injected update sites" ) || echo "W: Could not inject updatesites." 2>&1

exec $ECLIPSE "$@"
share|improve this question
up vote 3 down vote accepted

(strictly speaking not an answer to the question, but a suggestion how to install eclipse manually)

You should not change files in directories maintained by the package manager. The package manager keeps records about the files it installed. If the files are no longer there, or changed, then the package manager might refuse to continue working. Another problem might be when the package manager tries to upgrade the eclipse package, it might overwrite your files.

I suggest you install your own eclipse to /opt, or ~/opt, or any other directory not maintained by the package manager. You can then place a symlink in ~/bin pointing to your-eclipse-dir/eclipse.


$ mkdir -p ~/opt
$ cd ~/opt
# download or copy the eclipse tarball here
$ tar xzf eclipse-something.tar.gz
$ cd eclipse
$ ./eclipse # verify that eclipse works
$ cd ~/bin
$ ln -s ~/opt/eclipse/eclipse

Now you can start eclipse by typing eclipse. The symlink in ~/bin should shadow the eclipse executable /usr/bin/eclipse. If not, make sure that ~/bin is in $PATH and located before /usr/bin.

You can check which eclipse you are executing by using which:

$ which eclipse
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.