Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/eclipse/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/scala/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Eclipse 在scalaide中构建项目时出现的问题_Eclipse_Scala_Scala Ide - Fatal编程技术网

Eclipse 在scalaide中构建项目时出现的问题

Eclipse 在scalaide中构建项目时出现的问题,eclipse,scala,scala-ide,Eclipse,Scala,Scala Ide,我正在使用ScalaIDEEclipseVersion4.4.0和Scala2.11.8。我能够使用sbt compile从命令行编译项目,并使用sbt eclipse创建特定于eclipse的项目文件(为此使用sbteclipse)。然而,当我点击上下文菜单中的buildproject时,它给出了一个异常 **Errors occurred during the build. Errors running builder 'Scala Builder' on project project_n

我正在使用ScalaIDEEclipseVersion4.4.0和Scala2.11.8。我能够使用sbt compile从命令行编译项目,并使用sbt eclipse创建特定于eclipse的项目文件(为此使用sbteclipse)。然而,当我点击上下文菜单中的buildproject时,它给出了一个异常

**Errors occurred during the build.
Errors running builder 'Scala Builder' on project project_name.
org.eclipse.core.internal.resources.File cannot be cast to org.eclipse.core.resources.IContainer**
这里是相同的错误日志

**!ENTRY org.scala-ide.sdt.core 4 0 2017-01-09 14:13:56.020
!MESSAGE Error thrown while initializing the presentation compiler.
!STACK 0
java.lang.ClassCastException: org.eclipse.core.internal.resources.File cannot be cast to org.eclipse.core.resources.IContainer
    at org.scalaide.core.internal.project.ScalaProject$$anonfun$sourceOutputFolders$2$$anonfun$apply$7.apply(ScalaProject.scala:242)
    at org.scalaide.core.internal.project.ScalaProject$$anonfun$sourceOutputFolders$2$$anonfun$apply$7.apply(ScalaProject.scala:232)
    at scala.Option$WithFilter.map(Option.scala:207)
    at org.scalaide.core.internal.project.ScalaProject$$anonfun$sourceOutputFolders$2.apply(ScalaProject.scala:232)
    at org.scalaide.core.internal.project.ScalaProject$$anonfun$sourceOutputFolders$2.apply(ScalaProject.scala:231)
    at scala.collection.TraversableLike$WithFilter$$anonfun$flatMap$2.apply(TraversableLike.scala:714)
    at scala.collection.immutable.List.foreach(List.scala:381)
    at scala.collection.TraversableLike$WithFilter.flatMap(TraversableLike.scala:713)
    at org.scalaide.core.internal.project.ScalaProject.sourceOutputFolders(ScalaProject.scala:231)
    at org.scalaide.core.internal.project.ScalaProject.initializeCompilerSettings(ScalaProject.scala:478)
    at org.scalaide.core.internal.project.ScalaProject.org$scalaide$core$internal$project$ScalaProject$$prepareCompilerSettings(ScalaProject.scala:435)
    at org.scalaide.core.internal.project.ScalaProject$$anonfun$5.apply(ScalaProject.scala:159)
    at org.scalaide.core.internal.project.ScalaProject$$anonfun$5.apply(ScalaProject.scala:159)
    at org.scalaide.core.internal.compiler.PresentationCompilerProxy.liftedTree1$1(PresentationCompilerProxy.scala:152)
    at org.scalaide.core.internal.compiler.PresentationCompilerProxy.create(PresentationCompilerProxy.scala:151)
    at org.scalaide.core.internal.compiler.PresentationCompilerProxy.initialize(PresentationCompilerProxy.scala:116)
    at org.scalaide.core.internal.compiler.PresentationCompilerProxy.obtainPc$1(PresentationCompilerProxy.scala:78)
    at org.scalaide.core.internal.compiler.PresentationCompilerProxy.internal(PresentationCompilerProxy.scala:98)
    at org.scalaide.core.internal.jdt.model.ScalaCompilationUnit$class.addToIndexer(ScalaCompilationUnit.scala:157)
    at org.scalaide.core.internal.jdt.model.ScalaSourceFile.addToIndexer(ScalaSourceFile.scala:66)
    at org.scalaide.core.internal.jdt.search.ScalaSourceIndexer$$anonfun$indexDocument$2.apply(ScalaSourceIndexer.scala:16)
    at org.scalaide.core.internal.jdt.search.ScalaSourceIndexer$$anonfun$indexDocument$2.apply(ScalaSourceIndexer.scala:16)
    at scala.Option.map(Option.scala:146)
    at org.scalaide.core.internal.jdt.search.ScalaSourceIndexer.indexDocument(ScalaSourceIndexer.scala:16)
    at scala.tools.eclipse.contribution.weaving.jdt.indexerprovider.IndexerProviderAspect.ajc$around$scala_tools_eclipse_contribution_weaving_jdt_indexerprovider_IndexerProviderAspect$1$16276a3c(IndexerProviderAspect.aj:30)
    at org.eclipse.jdt.internal.core.search.JavaSearchParticipant.indexDocument(JavaSearchParticipant.java:71)
    at org.eclipse.jdt.internal.core.search.indexing.IndexManager.indexDocument(IndexManager.java:504)
    at org.eclipse.jdt.internal.core.search.indexing.IndexManager$1.execute(IndexManager.java:984)
    at org.eclipse.jdt.internal.core.search.processing.JobManager.run(JobManager.java:405)
    at java.lang.Thread.run(Thread.java:745)**

您的Scala IDE Eclipse插件使用内部类而不是Eclipse中的公共API失败(
org.Eclipse.
..
..
.internal.
..org.scalaide.
..中的类)。这可能是由于在较新版本的Eclipse中使用较旧版本的Scala插件造成的


使用和的最新版本,或者使用包含Eclipse、Scala和Scala插件的,这些版本已经一起测试过。

您的Scala IDE Eclipse插件由于使用内部类而不是Eclipse的公共API而失败(
org.eclipse.
ClassCastException
org.scalaide.
中的
ClassCastException.
内部。类)。这可能是由于在较新版本的eclipse中使用较旧版本的Scala插件造成的


使用和的最新版本,或者使用包含Eclipse、Scala和Scala插件的,这些版本已经一起测试过。

可能sbteclipse插件做错了什么?尝试从Scala IDE导入sbt项目(它应该自己创建eclipse项目)@pedrorijo91无法从scala IDE获取“sbt项目”。我正在使用命令行中的sbt生成特定于eclipse的项目文件,以将其导入eclipse。如何直接从scala IDE执行?我从未使用过scala IDE,只有Intellij(但它们类似)。可能在文件>导入/创建新项目下可能sbteclipse插件出错?尝试从scala IDE导入sbt项目(它应该自己创建eclipse项目)@pedrorijo91无法从scala IDE获取“sbt项目”。我正在从命令行使用sbt生成特定于eclipse的项目文件,以将其导入eclipse。如何直接从scala IDE导入?我从未使用过scala IDE,只有Intellij(但它们类似)。可能在文件>导入/创建新项目下