我正在尝试编写一个简单的批处理脚本来测试我的Scala程序。脚本应该是这样的:
#!/bin/bash
scala ./build/classes/MyClass "../../res/some_file.txt"这将返回:
Exception in thread "main" java.lang.RuntimeException: Cannot figure out how to run target: ./build/classes/MyClass如果我在classes目录中运行:
#!/bin/bash
scala MyClass "../../res/some_file.txt"按照预期工作。
我在这里做错了什么?
-Lee
发布于 2012-03-02 04:55:39
您不能传递类的文件名--您必须传递类名,而且它必须在类路径中。因此,试着这样做:
#!/bin/bash
scala -cp ./build/classes MyClass "../../res/some_file.txt"https://stackoverflow.com/questions/9523061
复制相似问题