错误: 找不到或无法加载主类 quickanswer.chapter8.p1
Scala project won't compile in Eclipse; “Could not find the main class.”
原因,是项目中源代码有错误,eclipse 就不编译其他源代码了,但是 eclipse 左边的树确没有错误的提示,让人以为项目中没有代码方面的错误
但是 eclipse 左边的树确的红叉是怎么消失的?
project->clean 操作后,左边树的错误提示就消失了... 这 bug!!!啊
再仔细点发现,消失红叉的是java文件,如果scala文件出错了还是有红叉提示的
原来混合java 和scala的不编译的问题已经是世界人民的问题啊
混合java 和scala 不编译的问题 "Project | Clean
It's a tricky one: solving this properly requires deeper cooperation
between the Scala and Java compilers than is present at the moment.
IMO the best line of attack is a more general one which addresses the
joint-compilation problem for all JVM languages that want to play ...
there's been some discussion of this on the JVM languages list
recently,(解决这个问题需要更深层次的scala和java编译器之间的合作)
between the Scala and Java compilers than is present at the moment.
IMO the best line of attack is a more general one which addresses the
joint-compilation problem for all JVM languages that want to play ...
there's been some discussion of this on the JVM languages list
recently,(解决这个问题需要更深层次的scala和java编译器之间的合作)
joint compile java scala mix 混合编译的解决办法 是用maven,在maven 里配置编译顺序 ,先scala后java 或者 先java后scala
不过,最新版(
Version 4.2.0
)是这么介绍的
Features
Support for Mixed Scala/Java Projects
Support for mixed Scala/Java projects and any combination of Scala/Java project dependencies, allowing straightforward references from Scala to Java and vice versa.所以呢,不是eclipse 不支持混合java 和 scala ,只是支持的还不是很好,还是有bug 的
测试了另外一个IDE工具IntelliJ IDEA 14.1,没有如上问题,很完美 perfect!
至于在eclipse 开发,目前只有自己小心点了吧,保证java和scala编译时不出错哦,如果java文件有错误,再clean,左边java文件的错误提示会消失哦,照成找问题的困难度哦
期待scala eclipse plugin 的下一个版本吧
或者在某些情况可以试试这些操作吧:
调整编译器顺序:右键项目-properties-scala Compiler -Build manager : set the compile order to JavaThenScala instead of Mixed
相关推荐
Eclipse-Scala-IDE-Oxgen.zip Eclipse Scala IDE 环境的配置配套的插件. 教程地址: https://yanxml.blog.csdn.net/article/details/89250222 Eclipse 版本: Oxygen.
scala eclipse插件.对应scala版本:2.10--2.11,对应eclipes版本:4.4--4.5. update site:http://download.scala-ide.org/sdk/lithium/e44/scala211/stable/site 下载地址:...
赠送jar包:scala-parser-combinators_2.11-1.0.4.jar; 赠送原API文档:scala-parser-combinators_2.11-1.0.4-javadoc.jar; 赠送源代码:scala-parser-combinators_2.11-1.0.4-sources.jar; 赠送Maven依赖信息...
赠送jar包:scala-compiler-2.11.8.jar; 赠送原API文档:scala-compiler-2.11.8-javadoc.jar; 赠送源代码:scala-compiler-2.11.8-sources.jar; 赠送Maven依赖信息文件:scala-compiler-2.11.8.pom; 包含翻译后...
scala211-eclipse-plugin(4.4and4.5).zip
赠送jar包:scala-parser-combinators_2.11-1.0.4.jar; 赠送原API文档:scala-parser-combinators_2.11-1.0.4-javadoc.jar; 赠送源代码:scala-parser-combinators_2.11-1.0.4-sources.jar; 包含翻译后的API...
scala-SDK-4.7.0-vfinal-2.12-win32.win32.x86_64 scala-SDK-4.7.0-vfinal-2.12-win32.win32.x86_64
IntellJIDEA Scala插件:scala-intellij-bin-2016.3.9
赠送jar包:scala-parser-combinators_2.12-1.1.0.jar; 赠送原API文档:scala-parser-combinators_2.12-1.1.0-javadoc.jar; 赠送源代码:scala-parser-combinators_2.12-1.1.0-sources.jar; 赠送Maven依赖信息...
赠送jar包:scala-compiler-2.11.12.jar; 赠送原API文档:scala-compiler-2.11.12-javadoc.jar; 赠送源代码:scala-compiler-2.11.12-sources.jar; 赠送Maven依赖信息文件:scala-compiler-2.11.12.pom; 包含...
eclipse-scala-plugin插件 测试可用功
赠送jar包:scala-compiler-2.12.7.jar; 赠送原API文档:scala-compiler-2.12.7-javadoc.jar; 赠送源代码:scala-compiler-2.12.7-sources.jar; 赠送Maven依赖信息文件:scala-compiler-2.12.7.pom; 包含翻译后...
scala-intellij-bin-2021.3.6.zip
赠送jar包:scala-reflect-2.11.8.jar; 赠送原API文档:scala-reflect-2.11.8-javadoc.jar; 赠送源代码:scala-reflect-2.11.8-sources.jar; 赠送Maven依赖信息文件:scala-reflect-2.11.8.pom; 包含翻译后的API...
scala-SDK-4.7.0-vfinal-2.12-linux.gtk.x86_64.tar.gz scala-SDK-4.7.0-vfinal-2.12-linux.gtk.x86_64.tar.gz
scala-intellij-bin-2018.3.2.zip插件,亲测可用!!!scala-intellij-bin-2018.3.2.zip插件,亲测可用!!!scala-intellij-bin-2018.3.2.zip插件,亲测可用!!!
赠送jar包:scala-parser-combinators_2.12-1.1.0.jar; 赠送原API文档:scala-parser-combinators_2.12-1.1.0-javadoc.jar; 赠送源代码:scala-parser-combinators_2.12-1.1.0-sources.jar; 赠送Maven依赖信息...
scala-intellij-bin-2020.2.3.zip
scala-actors-2.10 jar包,可以解决 scala-actors-2.10以上版本带来的不兼容问题
maven-scala-plugin-2.12.jar