Scala IDE错误 - 无法找到/加载主类 [英] Scala IDE Error -could not find/load main class

查看:161
本文介绍了Scala IDE错误 - 无法找到/加载主类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Scala IDE 4.4.1。,使用jdk 8.当我尝试运行scala程序时,收到错误错误:无法找到或加载主类example.Credit。

I am using Scala IDE 4.4.1.,using the jdk 8.When I try to run a scala program ,getting the error "Error: Could not find or load main class example.Credit" .

推荐答案

几天前我遇到了同样的错误。在我的例子中,我的JDK和我的Scala项目的选定目标JVM是不兼容的。

I was stuck with the same error a few days ago. In my case, it was an incompatibility of my JDK and the selected target JVM for my Scala project.

要检查当前的Java版本,请运行命令行上的java -version 。要在Eclipse中检查项目JVM目标,请转到项目>属性> Scala编译器并检查目标JVM(选择与当前Java相同的版本)。

To check your current Java version, run java -version on the command line. To check your project JVM target in Eclipse, go to "Project > Properties > Scala Compiler" and check the target JVM (choose the same version as your current Java).

希望它有所帮助。

这篇关于Scala IDE错误 - 无法找到/加载主类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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