简体   繁体   English

如何在Ubuntu 12.10(Quantal Quetzal)中使用C ++安装Eclipse?

[英]How do I install Eclipse with C++ in Ubuntu 12.10 (Quantal Quetzal)?

I just installed Ubuntu 12.10, and I tried to install Eclipse and C++, but I failed miserably. 我刚刚安装了Ubuntu 12.10,我尝试安装Eclipse和C ++,但我失败了。

I started with an installation from the Software Center, Eclipse worked, but only in Java. 我从软件中心开始安装,Eclipse工作,但仅限于Java。 Then I started googling for installation guides and tutorials, but after hours of downloads and installations, the C++ in Eclipse still doesn't work. 然后我开始谷歌搜索安装指南和教程,但经过几个小时的下载和安装后,Eclipse中的C ++仍然不起作用。

So now I have two questions: 所以现在我有两个问题:

  1. How do I clean up this mess? 我该如何清理这个烂摊子?
    Actually, how do I know if there is a mess? 实际上,我怎么知道是否有一团糟?
    According to the Ubuntu Software Center, Eclipse is installed and has three add-ons. 根据Ubuntu软件中心的说法,Eclipse已安装并有三个附加组件。
    How do I know if the other installations of other Eclipse versions/packagings overwrote each other or if I have multiple installations? 我怎么知道其他Eclipse版本/包装的其他安装是否相互覆盖,或者我是否有多个安装?

  2. How do I install the latest version of Eclipse and C++ in Ubuntu 12.10? 如何在Ubuntu 12.10中安装最新版本的Eclipse和C ++?

There is a package called eclipse-cdt in the Ubuntu 12.10 repositories, this is what you want. 在Ubuntu 12.10存储库中有一个名为eclipse-cdt的包,这就是你想要的。 If you haven't got g++ already, you need to install that as well, so all you need is: 如果你还没有g++ ,你也需要安装它,所以你只需要:

sudo apt-get install eclipse eclipse-cdt g++

Whether you messed up your system with your previous installation attempts depends heavily on how you did it. 您是否将先前的安装尝试搞砸了系统,在很大程度上取决于您是如何做到的。 If you did it the safe way for trying out new packages not from repositories (ie, only installed in your home folder, no sudo s blindly copied from installation manuals...) you're definitely fine. 如果你这样做是尝试不是从存储库中安装新软件包的安全方式(即,只安装在你的主文件夹中,没有从安装手册中盲目复制sudo ......)你绝对没问题。 Otherwise, you may well have thousands of stray files all over your file system now. 否则,您现在可能在文件系统中有数千个杂散文件。 In that case, run all uninstall scripts you can find for the things you installed, then install using apt-get and hope for the best. 在这种情况下,运行您可以找到的所有卸载脚本,然后使用apt-get安装,并希望获得最佳效果。

I used (the suggested answer from above) 我用过(上面的建议答案)

sudo apt-get install eclipse eclipse-cdt g++

but ONLY after then also doing 但只有在那之后也要做

sudo eclipse -clean

Hope that also helps. 希望这也有帮助。

I also tried http://www.eclipse.org/cdt/ in Ubuntu 12.04.2 LTS and works fine! 我也在Ubuntu 12.04.2 LTS中试过http://www.eclipse.org/cdt/并且工作正常!

  1. First, I downloaded it from www.eclipse.org/downloads/, choosing Eclipse IDE for C/C++ Developers. 首先,我从www.eclipse.org/downloads/下载它,为C / C ++开发人员选择Eclipse IDE。
  2. I save the file somewhere, let´s say into my home directory. 我将文件保存在某处,让我说到我的主目录。 Open a console or terminal, and type: 打开控制台或终端,然后键入:

    >>cd ~; tar xvzf eclipse*.tar.gz;

  3. Remember for having Eclipse running in Linux, it is required a JVM, so download a jdk file eg jdk-7u17-linux-i586.rpm (I cann´t post the link due to my low reputation) ... anyway 记得让Eclipse在Linux上运行,它需要一个JVM,所以下载一个jdk文件,例如jdk-7u17-linux-i586.rpm(由于我的声誉很低,我不能发布链接)......无论如何

  4. Install the .rpm file following http://www.wikihow.com/Install-Java-on-Linux 按照http://www.wikihow.com/Install-Java-on-Linux安装.rpm文件

  5. Find the path to the Java installation, by typing: 通过键入以下内容找到Java安装的路径:

    >>which java

  6. I got /usr/bin/java. 我有/ usr / bin / java。 To start up Eclipse, type: 要启动Eclipse,请键入:

    >>cd ~/eclipse; ./eclipse -vm /usr/bin/java

Also, once everything is installed, in the home directory, you can double-click the executable icon called eclipse, and then you´ll have it!. 此外,一旦安装完所有内容,在主目录中,您可以双击名为eclipse的可执行图标,然后就可以了! In case you like an icon, create a .desktop file in /usr/share/applications: 如果您喜欢图标,请在/ usr / share / applications中创建一个.desktop文件:

>>sudo gedit /usr/share/applications/eclipse.desktop

The .desktop file content is as follows: .desktop文件内容如下:

[Desktop Entry]  
Name=Eclipse  
Type=Application  
Exec="This is the path of the eclipse executable on your machine"  
Terminal=false 
Icon="This is the path of the icon.xpm file on your machine"  
Comment=Integrated Development Environment  
NoDisplay=false  
Categories=Development;IDE  
Name[en]=eclipse.desktop  

Best luck! 好运!

I was in the same boat. 我在同一条船上。 Installed Eclipse, realized need CDT. 安装Eclipse,实现需要CDT。

sudo apt-get install eclipse eclipse-cdt g++ sudo apt-get install eclipse eclipse-cdt g ++

This just adds the CDT package on top of existing installation - no un-installation etc. required. 这只是在现有安装的基础上添加了CDT包 - 无需卸载等。

http://www.eclipse.org/cdt/ ^Give that a try http://www.eclipse.org/cdt/ ^试一试

I have not used the CDT for eclipse but I do use Eclipse Java for Ubuntu 12.04 and it works wonders. 我没有使用CDT进行eclipse,但我确实使用Eclipse Java for Ubuntu 12.04,它可以创造奇迹。

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

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