scala “error: io error while decoding” “with utf-8”

前端 未结 4 1021
悲&欢浪女
悲&欢浪女 2021-02-12 13:31

this thing keeps coming up I checked that all my source files are utf8 encoded, and Im using \'-encoding UTF8\' flag with both scalac and scala command line tools
any ideas?

4条回答
  •  野性不改
    2021-02-12 14:05

    I was having this error trying to set a classpath to launch the scala interpreter like scala-2.8 /path/to/jars/*.

    The solutions in this thread Setting multiple jars in java classpath solved my problem; apparently the interpreter was attempting to open a jar file as if it was a text file containing scala commands.

    Actually, I noticed that just putting the classpath in quotes prevents this message. The message means it is trying to load a .jar file as a scala program to be interpreted. It can't since it's binary.

    scala-2.8 "/path/to/jars/*" works fine. The classpath and asterisk is then expanded by Java, not the shell.

提交回复
热议问题