SBT Eclipse應該生成一個正確設置了一切的項目文件。您需要在任何構建文件更改後運行「sbt update」,然後重新生成eclipse項目文件。我懷疑這可能是你的問題。在後者的文件src/main/scala
和src/main/java
添加爲src
項
<projectDescription>
<name>default-0d85ea</name>
<buildSpec>
<buildCommand>
<name>org.scala-ide.sdt.core.scalabuilder</name>
</buildCommand>
</buildSpec>
<natures>
<nature>org.scala-ide.sdt.core.scalanature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
和
<classpath>
<classpathentry output="target/scala-2.9.2/classes" path="src/main/scala" kind="src"></classpathentry>
<classpathentry output="target/scala-2.9.2/classes" path="src/main/java" kind="src"></classpathentry>
<classpathentry output="target/scala-2.9.2/test-classes" path="src/test/scala" kind="src"></classpathentry>
<classpathentry output="target/scala-2.9.2/test-classes" path="src/test/java" kind="src"></classpathentry>
<classpathentry path="org.scala-ide.sdt.launching.SCALA_CONTAINER" kind="con"></classpathentry>
<classpathentry path="/home/dcs/.ivy2/cache/org.scalacheck/scalacheck_2.9.2/jars/scalacheck_2.9.2-1.9.jar" kind="lib"></classpathentry>
<classpathentry path="/home/dcs/.ivy2/cache/org.scala-tools.testing/test-interface/jars/test-interface-0.5.jar" kind="lib"></classpathentry>
<classpathentry path="/home/dcs/.ivy2/cache/org.scala-lang/scala-swing/jars/scala-swing-2.9.2.jar" kind="lib"></classpathentry>
<classpathentry path="org.eclipse.jdt.launching.JRE_CONTAINER" kind="con"></classpathentry>
<classpathentry path="bin" kind="output"></classpathentry>
</classpath>
注:
應該生成兩個文件,.project
和.classpath
,像這樣的。
你已經嘗試過File> Import> General> Existing Projects into Workspace? –