如何使用终端在 Ubuntu 12.04 上安装最新版本的 Eclipse Classic?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12003815/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to install the latest version of Eclipse Classic on Ubuntu 12.04 using the terminal?
提问by CompilingCyborg
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.
请问如何使用终端在 Ubuntu 12.04 上安装最新的 Eclipse Classic (4.2)?如果你能指导我一步一步,我将不胜感激。
采纳答案by Mark Hillick
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 "" ] ; then
echo "W: Cannot find " 2>&1
return 1
fi
cat - >>"" <<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.
哪个有效。
回答by krizna
Step 1 ?Install java JDK or JRE
第1步 ?安装 java JDK 或 JRE
sudo apt-get install openjdk-7-jdk
Step 2 ?Download latest copy from here http://www.eclipse.org/downloads/?osType=linux
第2步 ?从这里下载最新副本 http://www.eclipse.org/downloads/?osType=linux
Step 3 ?Move the downloaded package to /opt directory
第 3 步?将下载的包移动到 /opt 目录
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.desktopin /usr/share/applications/and add the below lines .
第 5 步?在/usr/share/applications/ 中创建一个新的桌面文件eclipse.desktop并添加以下行。
[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.desktopfile to the launcher.
第 6 步?只需将此eclipse.desktop文件拖到启动器即可。
Check this link : install eclipse in ubuntu 12.04
回答by user3420279
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.
确保在执行 tar 命令之前 cd 到 /opt 文件夹。如果不这样做,那么 tar 命令将在您当前的任何目录中创建 eclipse 目录。
回答by Riyafa Abdul Hameed
After installing java JDK or JRE run the following command and it'll install eclipse for you,
安装 java JDK 或 JRE 后,运行以下命令,它将为您安装 eclipse,
sudo apt-get install eclipse
sudo apt-get 安装 eclipse