为什么 C++ 透视图和新项目选项在 Eclipse 中不可用?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/16783536/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Why are the C++ perspective and new project options not available in Eclipse?
提问by tvStatic
I installed the "Eclipse IDE for Java Developers" package from the Eclipse website. I work with C++ projects as well, so I used the "Install New Software..." menu option to install the "C/C++ Development Tools" package. After doing so and restarting Eclipse, the C++ perspective did not appear; clicking on the "Open Perspective" button did not show the "C/C++" option. I also found that I was unable to create a C++ project; the "C/C++" tree node did not appear in the New Project wizard. The Java perspective and new project options were available.
我从 Eclipse 网站安装了“Eclipse IDE for Java Developers”包。我也使用 C++ 项目,所以我使用“安装新软件...”菜单选项来安装“C/C++ 开发工具”包。这样做并重新启动Eclipse后,C++透视图没有出现;单击“打开透视图”按钮未显示“C/C++”选项。我还发现我无法创建 C++ 项目;“C/C++”树节点未出现在“新建项目”向导中。Java 透视图和新项目选项可用。
I verified that CDT was installed by going to the "Installed Installation Details" dialog - "C/C++ Development Tools" appeared in the "Installed Software" list. I tried uninstalling this package and reinstalled it again without success. I tried removing the Eclipse installation altogether and installing the "Eclipse IDE for C/C++ Developers". There were no C/C++ options in this installation either. I checked the .log
file in the workspace directory and found nothing unusual.
我通过转到“已安装的安装详细信息”对话框来验证 CDT 是否已安装 - “C/C++ 开发工具”出现在“已安装的软件”列表中。我尝试卸载此软件包并重新安装,但没有成功。我尝试完全删除 Eclipse 安装并安装“Eclipse IDE for C/C++ Developers”。此安装中也没有 C/C++ 选项。我检查了.log
工作区目录中的文件,没有发现任何异常。
Why are the C/C++ features not available after installing the CDT feature in Eclipse?
为什么在 Eclipse 中安装 CDT 功能后 C/C++ 功能不可用?
采纳答案by tvStatic
The path for this system Eclipse was installed on included a 1.3.1 version of the Java runtime environment and the Eclipse executable was using this version to run Eclipse. Unfortunately, there doesn't appear to be any indication of this in Eclipse, nor any indication that anything failed.
安装 Eclipse 的此系统的路径包括 Java 运行时环境的 1.3.1 版本,并且 Eclipse 可执行文件使用此版本来运行 Eclipse。不幸的是,在 Eclipse 中似乎没有任何迹象表明这一点,也没有任何迹象表明任何事情都失败了。
Using the instructions here, I changed the JVM to javaw.exe
in a Java 7 installation. After doing so, the C/C++ perspective and new project options appeared in Eclipse.
使用此处的说明,我将 JVM 更改javaw.exe
为 Java 7 安装。这样做之后,C/C++ 透视图和新项目选项出现在 Eclipse 中。
回答by Wang3t
I ran into the similar problem with Eclipse-Luna(4.4) on Yosemite(10.10). - NOT able to get the C/C++ perspective with JRE (8u25) or java 1.6 on Yosemite.
我在 Yosemite(10.10) 上遇到了与 Eclipse-Luna(4.4) 类似的问题。- 无法在 Yosemite 上使用 JRE (8u25) 或 java 1.6 获得 C/C++ 透视图。
But I manage to get C/C++ perspective with the installation of JDK(8u25).
但是我设法通过安装 JDK(8u25) 获得了 C/C++ 视角。
回答by ransh
I also had the same issue.
我也有同样的问题。
I just installed java7 and restarted eclipse:
我刚刚安装了java7并重新启动了eclipse:
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
回答by Kevin Jesse
The fix for me was to install the latest JDK from Oracle. I had a fresh install of Yosemite and the Eclipse for Java developers. The C/C++ option showed up after the install and restart of Eclipse. Hope it helps!
我的解决方法是从 Oracle 安装最新的 JDK。我为 Java 开发人员重新安装了 Yosemite 和 Eclipse。C/C++ 选项在安装并重启 Eclipse 后出现。希望能帮助到你!
回答by mike scholtes
I had this same problem on Linux (CentOS 6.5 32-bit) with Eclipse Luna:
我在使用 Eclipse Luna 的 Linux(CentOS 6.5 32 位)上遇到了同样的问题:
- I installed standard Eclipse (eclipse-java-luna-SR1-linux-gtk.tar.gz)
- In eclipse, under Help->Install New Software I added the p2 software repository to the list of sites: http://download.eclipse.org/tools/cdt/releases/8.5
- I installed C/C++ Development Tools and C/C++ Development Tools SDK
- In CentOS, I also installed OpenJDK Development Environment java-1.7.0-devel-1:1.7.0.65-2.5.1.2.el6_5 (i686).
- I edited eclipse.ini to increase the Xmx setting to 1024m from 256m, but I did not add a -vm property. In the Eclipse preferences after restarting, I verified it was using JDK 1.7.
- 我安装了标准的 Eclipse (eclipse-java-luna-SR1-linux-gtk.tar.gz)
- 在 Eclipse 中,在 Help->Install New Software 下,我将 p2 软件存储库添加到站点列表中:http: //download.eclipse.org/tools/cdt/releases/8.5
- 我安装了 C/C++ 开发工具和 C/C++ 开发工具 SDK
- 在 CentOS 中,我还安装了 OpenJDK 开发环境 java-1.7.0-devel-1:1.7.0.65-2.5.1.2.el6_5 (i686)。
- 我编辑了 eclipse.ini 以将 Xmx 设置从 256m 增加到 1024m,但我没有添加 -vm 属性。在重新启动后的 Eclipse 首选项中,我验证它使用的是 JDK 1.7。
The C++ perspective was not contained in the list of available perspectives.
C++ 透视图未包含在可用透视图列表中。
But C++ Project wasan option in the File->New menu, and when I chose it, Eclipse asked me if I wanted to use the C++ perspective. I said yes, and it appeared, and is now available in the perspectives list as well.
但是C++ Project是File->New 菜单中的一个选项,当我选择它时,Eclipse 会问我是否要使用C++ 透视图。我说是的,它出现了,现在也可以在透视列表中找到。