开发者

Java in Eclipse: generating .class file automatically

when I change my foo.java file in Eclipse there are no changes in the foo.class inside the bin folder.

I think there must be a way that Eclipse change this automatically when altering an foo.java file?

I even can't make it manually.

开发者_高级运维

Hope you can help me.

Thanks


  • Make sure it's a java project
  • Make sure the java file is in a source folder (right click project, properties, build path)
  • Make sure you have automatic build turned on (Project menu -> Build automatically)


One of the other most important things people forgot to mention is that you also need to check the "problems" view to make sure there are not errors in your project. To view problems:

Window -> show view -> Problems

If there are 'Errors' you need to correct those before the eclipse can compile.


I know this is an old post, but I wanted to contribute in case someone else comes across this problem. When I experienced this problem (today) the build path looked good, class path looked good, default output directory was good, Java compiler looked good, but nothing. Then I selected Project, Properties, Builders and it said the builder was missing...the builder was incorrect. I removed the missing builder, opened the .project file (you may have to adjust the navigation filters to see this) and added:

    <buildCommand>
        <name>org.eclipse.jdt.core.javabuilder</name>
        <arguments>
        </arguments>
    </buildCommand>

inside the buildSet tags, and viola everything works. Hope this helps someone.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜