Why do I get java.lang.NoClassDefFoundError when I trying to run this code?

后端 未结 2 1239
再見小時候
再見小時候 2021-02-19 05:50

I want to map over the characters in a string, but I\'m getting runtime errors.

Example:

object Hello {
    def hello(c: Char) {
        print(c)
    }

         


        
2条回答
  •  星月不相逢
    2021-02-19 06:48

    I think that your problem is that scala library is not in your runtime classpath. you must manually add manually.

    If you are using tools like maven or sbt, maybe the dependency is marked as provided instead compiled.

    If you are not using these tools, add "scala-library.jar" to your library directory

提交回复
热议问题