求救eclipse安装问题

软件和网站开发以及相关技术探讨
回复
csr_hema
帖子: 4
注册时间: 2010-12-24 13:52
送出感谢: 0
接收感谢: 0

求救eclipse安装问题

#1

帖子 csr_hema » 2011-03-16 22:07

我以前在电脑中安装好了eclipse sdk 3.5.2版本,现在因为特殊的原因,想升级sdk版本,于是下载了一个eclipse sdk 3.6.2版本,解压缩,放置到opt/eclipse/目录下,修改了usr/bin/eclipse文件,然后启动的程序总是以前那个旧版本的(3.5.2),找了找原因,发现是因为usr/bin/eclipse文件中的:
#!/bin/sh

# work around for e#290395 / LP: #458703
# https://bugs.eclipse.org/bugs/show_bug.cgi?id=290395
# https://bugs.launchpad.net/bugs/458703
export GDK_NATIVE_WINDOWS=true

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

ECLIPSE=/usr/lib/eclipse/eclipse
#ECLIPSE=/opt/eclipse/eclipse

export MOZILLA_FIVE_HOME=”/usr/lib/mozilla/”
export ECLIPSE_HOME=”/opt/eclipse”

$ECLIPSE_HOME/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_galileo/enabled=true
repositories/http\:__download.eclipse.org_releases_galileo/isSystem=false
repositories/http\:__download.eclipse.org_releases_galileo/nickname=Galileo Update Site
repositories/http\:__download.eclipse.org_releases_galileo/uri=http\://download.eclipse.org/releases/galileo/
EOF

}


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

exec $ECLIPSE "$@"

上述文件中标示红字的地方出错,于是程序自动启动原来的版本,请教大家,这个问题该如何解决,谢谢
csr_hema
帖子: 4
注册时间: 2010-12-24 13:52
送出感谢: 0
接收感谢: 0

Re: 求救eclipse安装问题

#2

帖子 csr_hema » 2011-03-16 22:08

csr_hema 写了:我以前在电脑中安装好了eclipse sdk 3.5.2版本,现在因为特殊的原因,想升级sdk版本,于是下载了一个eclipse sdk 3.6.2版本,解压缩,放置到opt/eclipse/目录下,修改了usr/bin/eclipse文件,然后启动的程序总是以前那个旧版本的(3.5.2),找了找原因,发现是因为usr/bin/eclipse文件中的:
#!/bin/sh

# work around for e#290395 / LP: #458703
# https://bugs.eclipse.org/bugs/show_bug.cgi?id=290395
# https://bugs.launchpad.net/bugs/458703
export GDK_NATIVE_WINDOWS=true

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

ECLIPSE=/usr/lib/eclipse/eclipse
#ECLIPSE=/opt/eclipse/eclipse

export MOZILLA_FIVE_HOME=”/usr/lib/mozilla/”
export ECLIPSE_HOME=”/opt/eclipse”

$ECLIPSE_HOME/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_galileo/enabled=true
repositories/http\:__download.eclipse.org_releases_galileo/isSystem=false
repositories/http\:__download.eclipse.org_releases_galileo/nickname=Galileo Update Site
repositories/http\:__download.eclipse.org_releases_galileo/uri=http\://download.eclipse.org/releases/galileo/
EOF

}


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

exec $ECLIPSE "$@"

上述文件中标示红字的地方出错,于是程序自动启动原来的版本,请教大家,这个问题该如何解决,谢谢
不好意思,看错了,应该是这个地方报错:
echo "W: Cannot inject update-sites, cannot find the correct config." 2>&
头像
viewer坛
帖子: 33
注册时间: 2010-08-24 22:07
送出感谢: 0
接收感谢: 0

Re: 求救eclipse安装问题

#3

帖子 viewer坛 » 2011-04-07 19:01

直接解压安装包,然后打开文件夹里的eclipse就可以了
flycatcn
帖子: 79
注册时间: 2006-03-25 21:33
送出感谢: 0
接收感谢: 0

Re: 求救eclipse安装问题

#4

帖子 flycatcn » 2011-05-24 23:17

删除原有的eclipse文件。
在/home/usename目录下,删除eclipse的配置文件。在启动eclipse就可以了。

原版本和新版本的配置文件冲突。

在你更换了JDK之后,也需要删除配置文件,在启动eclipse
回复

回到 “软件/网站开发”