初学scala,按照网上的步骤,编写了一个hello world程序,debug时总是提示出错,如图所示。文字如下:
.......
Connected to the target VM, address: '127.0.0.1:60140', transport: 'socket'
错误: 找不到或无法加载主类 hello
Disconnected from the target VM, address: '127.0.0.1:60140', transport: 'socket'
Process finished with exit code 1
run也出错,文字如下:
.......
Exception in thread "main" java.lang.ClassNotFoundException: hello
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:116)
Process finished with exit code 1
但是在SBT console下,compile和run都没问题,如下:
> > compile
[success] Total time: 0 s, completed 2015-8-18 21:44:13
> run
[info] Running hello
hello world, I am coming
[success] Total time: 0 s, completed 2015-8-18 21:44:15
请教各位TX,要做哪些修改?
谢谢。
|
-
-
debug提示错误
|