Scala Main Class在Eclipse中找不到 [英] Scala Main Class not found in Eclipse ide

查看:158
本文介绍了Scala Main Class在Eclipse中找不到的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我安装了scala和scala IDE for eclipse。我每次尝试编译一个简单的HelloWorld时都会收到这个消息:

I installed scala and scala IDE for eclipse. I get this message everytime I try to compile a simple "HelloWorld":

package asd

object testobject {
  def main(args: Array[String]): Unit = {
    println("asda");
  }
}




错误:Mainclass asd.testobject无法找到

"Error: Mainclass asd.testobject could not be found"

新的Scala项目 - > asd

New Scala Project -> asd

新的Scala对象 - >复制并粘贴上面的代码

New Scala Object -> Copy&Paste the code above

运行As - > Scala应用程序

Run As -> Scala Application

我的问题是,我已经尝试了在互联网上发现的一切,它不工作。我真的不知道为什么它不工作。
Runconfig中的主类:asd.testobject。
我真的希望任何人都可以帮助我,我想我没有包括环境或scala jre在某个地方...?

My problem is that I've tried literally everything I found on the internet and it wont work. I really dont know why it doesnt work. Main class in Runconfig: asd.testobject. I really hope that anyone of you can help me, I think I didnt include the environment or scala jre somewhere...??


scala -version:2.11.6

scala -version : 2.11.6

EDIT :: @dragonborn
我不太确定什么你意思是?我做了一张照片,显示我的scala配置。你可以解释一下吗?

: @dragonborn I'm not quite sure what do you mean? I made a picture which shows my config for scala. Can you explain it?

我不能在这里发布图片,所以这里是链接:
scala config

I cannot post pictures here so here is the Link: scala config

推荐答案

不要使用eclipse,但是你试过这样吗?

I do not use eclipse, but have you tried this way?

object Test extends App {
println(hello world)
}

这篇关于Scala Main Class在Eclipse中找不到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆