scala - 从 hello-world 创建 scala 项目时出现 InvalidPathException
问题描述
$ java -version
java version "1.8.0_241"
Java(TM) SE Runtime Environment (build 1.8.0_241-b07)
Java HotSpot(TM) 64-Bit Server VM (build 25.241-b07, mixed mode)
当我使用以下命令时:
sbt new scala/hello-world.g8
我有以下错误:
$ sbt new scala/hello-world.g8 [error] java.nio.file.InvalidPathException: Trailing char < > at index 118: ModuleType Version Name
ExportedCommands
\Coursier\cache\v1 [error] 使用'last'获取完整日志. 项目加载失败:(r)etry、(q)uit、(l)ast 还是 (i)gnore?q
即使使用以下命令也会发生此错误:
$ sbt about [warn] no sbt.version set in project/build.properties, base directory: C:\Users\castelain.florianext\Documents\test\scala [error] java.nio.file.InvalidPathException: Trailing char < >在索引 118:ModuleType 版本名称
ExportedCommands
\Coursier\cache\v1 [错误] 对完整日志使用“最后一个”。项目加载失败:(r)etry、(q)uit、(l)ast 还是 (i)gnore?q
SBT 版本是:sbt script version: 1.3.8
我应该如何解决这个问题?
解决方案
build.properties
它抱怨在您的文件中找不到 sbt 版本。
尝试在您的test/scala
空文件夹中移动,然后键入:sbt sbtVersion
。这会将当前项目设置为您的scala
文件夹,因此应该在其中创建一个build.properties
设置了 sbt 版本的项目。
然后您可以再次尝试输入:sbt new scala/hello-world.g8
.
推荐阅读
- windows - 在将参数传递给 PS 文件时,如何使用 invoke-command 从 Windows 命令行运行 PS 文件?
- bash - 如何自动解决 git rebase 中的所有冲突,“git add .”
- android - AndroidStudio 播放按钮:INSTALL_PARSE_FAILED_NO_CERTIFICATES
- r - 获取 dplyr 中每个 dyad 的目标数据
- c++ - 如何在 Unreal 蓝图中创建等效的 Unity LookAt?
- php - CodeIgniter 4 ... documentRoot 不公开... htaccess 不工作
- linux - 转移到 DARwIN-OP 时出现很多错误
- c++ - 有没有办法可以在“.structurevariable”前面放置一个字符串数组成员?
- javascript - window.prompt 安全吗?
- c# - Arduino c# application light led stop led with c#