首页 > 解决方案 > 构建一个 sbt 程序集,然后使用 sbt 'run-main 运行' 失败并出现 [error] Not a valid command: run-main

问题描述

该问题出现在其他地方,人们建议使用 runMain,但最终会出现 ClassNotFoundException,而我得到的是这个跟踪:

sbt:reach-exe> run-main org.clulab.processors.server.ProcessorServer
[error] Expected ID character
[error] Not a valid command: run-main
[error] Expected project ID
[error] Expected configuration
[error] Expected ':'
[error] Expected key
[error] Not a valid key: run-main (similar: runMain, bgRunMain, fgRunMain)
[error] run-main org.clulab.processors.server.ProcessorServer
[error]         ^

对于好的 googlefoo,这是一个困难的查询。我错过了什么?提前致谢。

标签: sbt

解决方案


runMain在较新版本的 sbt 中。破折号分隔的名称前段时间已弃用。

如果只有一个main,您可以使用run命令。


推荐阅读