简体   繁体   English

为什么我不能安装Eclipse?

[英]Why can't I install Eclipse?

I am trying to install Eclipse. 我正在尝试安装Eclipse。

> desktop-file-install eclipse.desktop
> Error on file "eclipse.desktop": Key file does not start with a group


>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

What is wrong? 怎么了? My Ubuntu version is 10.04 but I do not know if that plays any role here. 我的Ubuntu版本是10.04,但我不知道它在这里是否起任何作用。

You need to add 您需要添加

[Desktop Entry]

to the top of your file--it's the group name that command is looking for. 文件的顶部-这是命令要查找的组名。 See here for more information about desktop entries. 有关台式机条目的更多信息,请参见此处

In order to install Eclipse you only need to have a working JDK installation and the unzip the eclipse bundle and finally execute eclipse. 为了安装Eclipse,您只需要安装一个有效的JDK,然后解压缩Eclipse捆绑包并最终执行eclipse。

To install OpenJDK from ubuntu repositories you can do this. 要从ubuntu存储库安装OpenJDK,可以执行此操作。

sudo apt-get install openjdk-6-jdk

OpenJDK7 does not seem to be in 10.04 repositories. OpenJDK7似乎不在10.04存储库中。

You can always install Oracle JDK manually but perhaps you should think about upgrading you ubuntu installation to the latest LTS release. 您始终可以手动安装Oracle JDK ,但也许您应该考虑将ubuntu安装升级到最新的LTS版本。

Try This option. 试试这个选项。

  • change permission for eclipse dir sudo chmode -R 755 -R /opt/eclipse . 更改eclipse目录的权限sudo chmode -R 755 -R /opt/eclipse

  • Java Home Java主页

open gedit /home/[user]/.bashrc Add that two line at the end . 打开gedit /home/[user]/.bashrc在最后添加这两行。

export JAVA_HOME=/path/to/jdk1.(xx version)

export PATH=$PATH:$JAVA_HOME:$JAVA_HOME/bin

Update 更新资料

  • As mentioned by @Allison 正如@Allison所提到的

    You need to add [Desktop Entry] 您需要添加[Desktop Entry]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM