How to install the latest version of Eclipse Class

2019-04-21 08:20发布

问题:

Please how to install the latest Eclipse Classic (4.2) on Ubuntu 12.04 using the terminal? if you can direct me step-by-step, I would be grateful.

回答1:

See this blog post here, for step-by-step instructions.

The process is documented step-by-step and in the comments the author has included a script -

#!/bin/sh

ECLIPSE=/usr/lib/eclipse/eclipse

inject_update_site(){
if [ ! -e "$1" ] ; then
echo "W: Cannot find $1" 2>&1
return 1
fi
cat - >>"$1" <<EOF
repositories/http\:__download.eclipse.org_releases_indigo/enabled=true
repositories/http\:__download.eclipse.org_releases_indigo/isSystem=false
repositories/http\:__download.eclipse.org_releases_indigo/nickname=Indigo Update Site
repositories/http\:__download.eclipse.org_releases_indigo/uri=http\://download.eclipse.org/releases/indigo/
EOF

}

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

exec $ECLIPSE "$@"

which works.



回答2:

Step 1 » Install java JDK or JRE

sudo apt-get install openjdk-7-jdk

Step 2 » Download latest copy from here http://www.eclipse.org/downloads/?osType=linux

Step 3 » Move the downloaded package to /opt directory

sudo mv eclipse-SDK-4.2.2-linux-gtk.tar.gz /opt

Step 4 » Extract the package

sudo tar -xvf /opt/eclipse-SDK-4.2.2-linux-gtk.tar.gz -C /opt

Step 5 » Create a new desktop file eclipse.desktop in /usr/share/applications/ and add the below lines .

[Desktop Entry]
Name=Eclipse 
Type=Application
Exec=/opt/eclipse/eclipse
Terminal=false
Icon=/opt/eclipse/icon.xpm
Comment=Integrated Development Environment
NoDisplay=false
Categories=Development;IDE
Name[en]=eclipse.desktop

Step 6 » Simply drag this eclipse.desktop file to the launcher.

Check this link : install eclipse in ubuntu 12.04



回答3:

Make sure to cd to the /opt folder before executing the tar command. If you don't then the tar command will create the eclipse directory in whatever your current directory is.



回答4:

After installing java JDK or JRE run the following command and it'll install eclipse for you,

sudo apt-get install eclipse