Source folder is not a Java project when working with Heroku eclipse plugin

随声附和 提交于 2020-02-23 07:38:09

问题


I have set up a new project and hooked it up with Heroku:

I'm able to make changes and upload them to my dyno at Heroku but when trying to add new classes in eclipse I get **Source folder is not a Java project **. Have I missed anything?


回答1:


Ok found it, needed to tell eclipse that this was a java project by adding:

<natures>
    <nature>
         <name></name>
     </nature>
     <nature>org.eclipse.jdt.core.javanature</nature>
 </natures>

So that the .project file look like this:

<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
    <name>morning-garden-3028</name>
    <comment></comment>
    <projects>
    </projects>
    <buildSpec>
    </buildSpec>
    <natures>
    <nature>
      <name></name>
    </nature>
    <nature>org.eclipse.jdt.core.javanature</nature>
  </natures>
</projectDescription>



回答2:


Go to Project->Properties->Java Build Path->Source->Add Folder, and add your source folder



来源:https://stackoverflow.com/questions/12663440/source-folder-is-not-a-java-project-when-working-with-heroku-eclipse-plugin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!