Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I used terminal to install eclipse with jdk7, and now I want to incorporate C/C++ development, so I installed a compiler (gcc 4.7) and and eclipse cdt plugin from the terminal: sudo apt-get install eclipse-cdt

But when I restarted eclipse and tried to change the perspective, there was no c++ option I cannot even create a new C++ project. Someone suggested that I do "Install New Software" and choose the cdt from the hard drive. If this is what I should do, where does terminal install its files to?

share|improve this question

I had similar problem before but with Java, the problem was fixed by doing

   eclipse -clean &

as it refreshes your workspace.

If it didn't work, you can try deleting workspace if it doesn't contain any valuable data and firing the above command again.

share|improve this answer

The perspective will change automatically when you start a new C++ project (File->New->Project..., Shift+Alt+N). If you want to force the change, open the menu Window->Open Perspective->Other... and from the window that pops up you can select the C/C++ entry.

share|improve this answer
What I mean is I cannot start a new c++ project because eclipse isn't recognizing that I installed a compiler and the eclipse cdt (both of which I installed via terminal). – Muhammad Khan Jun 12 '12 at 18:47
Ah, in that case install the package g++-4.7. – Michael Wild Jun 13 '12 at 13:00
@MuhammadKhan If installing some appropriate version of g++ for your Ubuntu release (as Michael Wild says) is for some reason unsuitable for your needs, then please edit your question to explain exactly how you installed the compiler that you do want to use (and, if possible, why using an Ubuntu-provided g++ is not suitable). That should make it possible to troubleshoot the problem further. In particular, please let us know where you put the g++ binaries and if they're in PATH (if you know). – Eliah Kagan Jul 20 '13 at 10:39

Ok, I installed eclipse through apt-get on a "relatively" clean Ubuntu 13.04 installation and experienced the problem referenced in this thread when I attempted to add the cdt (also through apt-get). I tried multiple things to resolve the issue, reinstalled repeatedly.

Before I got it fixed I did the following to switch from openjdk to oracle java, which may or may not be relevant:

sudo apt-get purge openjdk*
sudo rm /var/lib/dpkg/info/oracle-java7-installer*
sudo apt-get purge oracle-java7-installer*
sudo rm /etc/apt/sources.list.d/*java*
sudo apt-get update
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer

What eventually worked for me was:

sudo apt-get install eclipse eclipse-cdt g++
rm -rf ~/.eclipse
rm -rf ~/workspace
eclipse -clean &

Note: I didn't have any actual work in my workspace. If you do, you should back it up before doing something as drastic as removing it.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.