Scala eclipse 错误 -找不到或无法加载主类
2016-07-18 16:11
447 查看
错误: 找不到或无法加载主类 quickanswer.chapter8.p1
Scala project won't compile in Eclipse; “Could not find the main class.”
原因,是项目中源代码有错误,eclipse
就不编译其他源代码了,但是 eclipse 左边的树确没有错误的提示,让人以为项目中没有代码方面的错误 但是 eclipse 左边的树确的红叉是怎么消失的? project->clean 操作后,左边树的错误提示就消失了... 这 bug!!!啊 再仔细点发现,消失红叉的是Java文件,如果scala文件出错了还是有红叉提示的
查到http://stackoverflow.com/questions/4449218/mixing-scala-and-java-files-in-an-eclipse-project原来混合java 和scala的不编译的问题已经是世界人民的问题啊
混合java 和scala 不编译的问题 "Project | Clean
http://www.scala-lang.org/old/node/4754.html
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编译器之间的合作) joint compile
java scala mix 混合编译的解决办法 是用maven,在maven 里配置编译顺序 ,先scala后java 或者 先java后scala
http://ted-gao.blogspot.com/2011/09/mixing-scala-and-java-in-project.html
至于在eclipse 开发,目前只有自己小心点了吧,保证java和scala编译时不出错哦,如果java文件有错误,再clean,左边java文件的错误提示会消失哦,照成找问题的困难度哦 或者在某些情况可以试试这些操作吧:
调整编译器顺序:右键项目-properties-scala Compiler -Build manager :
set the compile order to JavaThenScala instead of Mixed
关键词:properly general present problem 源代码
--------------------------
以上是转载内容。
注意:我的做法是
右键项目-properties-scala Compiler -Build manager :
set the compile order to JavaThenScala instead of Mixed
scala Library,这里选择scala-2.10.5版本
弄好后clean项目。检查problem下面没有报错,然后就可以正常运行了。
Scala project won't compile in Eclipse; “Could not find the main class.”
原因,是项目中源代码有错误,eclipse
就不编译其他源代码了,但是 eclipse 左边的树确没有错误的提示,让人以为项目中没有代码方面的错误 但是 eclipse 左边的树确的红叉是怎么消失的? project->clean 操作后,左边树的错误提示就消失了... 这 bug!!!啊 再仔细点发现,消失红叉的是Java文件,如果scala文件出错了还是有红叉提示的
查到http://stackoverflow.com/questions/4449218/mixing-scala-and-java-files-in-an-eclipse-project原来混合java 和scala的不编译的问题已经是世界人民的问题啊
混合java 和scala 不编译的问题 "Project | Clean
http://www.scala-lang.org/old/node/4754.html
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编译器之间的合作) joint compile
java scala mix 混合编译的解决办法 是用maven,在maven 里配置编译顺序 ,先scala后java 或者 先java后scala
http://ted-gao.blogspot.com/2011/09/mixing-scala-and-java-in-project.html
至于在eclipse 开发,目前只有自己小心点了吧,保证java和scala编译时不出错哦,如果java文件有错误,再clean,左边java文件的错误提示会消失哦,照成找问题的困难度哦 或者在某些情况可以试试这些操作吧:
调整编译器顺序:右键项目-properties-scala Compiler -Build manager :
set the compile order to JavaThenScala instead of Mixed
关键词:properly general present problem 源代码
--------------------------
以上是转载内容。
注意:我的做法是
右键项目-properties-scala Compiler -Build manager :
set the compile order to JavaThenScala instead of Mixed
scala Library,这里选择scala-2.10.5版本
弄好后clean项目。检查problem下面没有报错,然后就可以正常运行了。
相关文章推荐
- Windows下Scala环境搭建
- MyEclipse Web Project转Eclipse Dynamic Web Project
- Windows Clang开发环境备忘
- 傻瓜式用Eclipse连接MySQL数据库
- Eclipse引入jquery报错如何解决
- 让Flex Builder 3.0与Eclipse3.4整合起来
- Eclipse配置Javascript开发环境图文教程
- 使用zend studio for eclipse不能激活代码提示功能的解决办法
- Windows7下安装Scala 2.9.2教程
- 图解Eclipse j2ee开发环境的搭建过程
- 两种Eclipse部署动态web项目方法
- ext for eclipse插件安装方法
- 解决Fedora14下eclipse进行android开发,ibus提示没有输入窗口的方法详解
- eclipse导入jquery包后报错的解决方法
- Eclipse 格式化代码时不换行与自动换行的实现方法
- Eclipse下jQuery文件报错出现错误提示红叉
- eclipse如何忽略js文件报错(附图)
- eclipse3.2.2 + MyEclipse5.5 + Tomcat5.5.27 配置数据库连接池
- jquery库或JS文件在eclipse下报错问题解决方法
- 什么是eclipse,eclipse的意思解析