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?

3 Answers 3


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.


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.

  • This method worked for me
    – Sonevol
    Nov 16, 2017 at 14:07

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.

  • 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). Jun 12, 2012 at 18:47
  • Ah, in that case install the package g++-4.7. Jun 13, 2012 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). Jul 20, 2013 at 10:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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