eclipse 删除后如何在Eclipse中重现bin文件夹?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2007186/
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
How to reproduce bin folder in Eclipse after it is deleted?
提问by Ph??ng Nguy?n
I'm switching out of Net Beans (since Netbeans intellisense speed was too fast for my patience). However, my habit since NetBeans age driving me nut with new Eclipse. Normally, when some thing is wrong inside Netbeans auto compile mechanism, I just go to build folder located under the project root and delete it (sometimes with Unlocker), then Net Beans will recreated that folder and put .class file into. However, recently, when I tried to do the same thing with bin folder under Eclipse project root, the bin folder will not be reproduced, even if I restart the IDE, turn off Build Automatically, and run Build All (Ctrl+B).
我要退出 Net Beans(因为 Netbeans 智能感知速度对我的耐心来说太快了)。然而,自从 NetBeans 老化以来,我的习惯让我对新的 Eclipse 感到厌烦。通常,当 Netbeans 自动编译机制内部出现问题时,我只需转到位于项目根目录下的 build 文件夹并将其删除(有时使用 Unlocker),然后 Net Beans 将重新创建该文件夹并将 .class 文件放入。但是,最近在Eclipse项目根目录下尝试用bin文件夹做同样的事情时,bin文件夹也不会重现,即使我重新启动IDE,关闭自动构建,并运行全部构建(Ctrl + B)。
采纳答案by Carl Smotricz
It's possible that bin
is not your class output folder. You should check in Project properties|Java Build Path|Source
.
这可能bin
不是您的类输出文件夹。你应该登记入住Project properties|Java Build Path|Source
。
回答by Gregory Pakosz
In the menu, don't turn off automatic build and click Project > Clean...
在菜单中,不要关闭自动构建并单击 Project > Clean...
回答by Carl Smotricz
Another possibility is that your project does not have "Java nature." Are you seeing source packages in the Package Explorer?
另一种可能性是您的项目没有“Java 性质”。您是否在包资源管理器中看到源包?
If not, this stanza should appear (or go) in your .project file:
如果没有,此节应该出现(或消失)在您的 .project 文件中:
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
回答by Carl Smotricz
Possibly not related to this problem, but something you need to be aware of is that Eclipse lies about the contents of its folders. More precisely, it reports the contents of internal models of all folders (i.e. contained files and sub-folders) and only refreshes that internal view when you explicitly refresh the view in the GUI.
可能与此问题无关,但您需要注意的是 Eclipse 会谎报其文件夹的内容。更准确地说,它报告所有文件夹(即包含的文件和子文件夹)的内部模型的内容,并且仅在您明确刷新 GUI 中的视图时才刷新该内部视图。
Especially when you manipulate files outside of Eclipse or using tools started from Eclipse but not directly tied into Eclipse, there WILL be differences Eclipse doesn't know about.
特别是当您在 Eclipse 之外操作文件或使用从 Eclipse 启动但未直接绑定到 Eclipse 的工具时,将会有 Eclipse 不知道的差异。
回答by perdian
Have you tried to recreate the bin folder directly on the file system and performed a refresh on the eclipse project?
您是否尝试过直接在文件系统上重新创建 bin 文件夹并对 eclipse 项目执行刷新?
回答by borino
Make sure that your .project
file should contain at minimum:
确保您的.project
文件至少应包含:
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
PS. For standard java project
附注。对于标准java项目