【发布时间】:2022-10-24 20:02:15
【问题描述】:
我正在尝试运行一个简单的命令来获取 Intellij IDEA (Mac OS) 中的当前工作目录:System.getProperty("user.dir")。
当我在常规 Scala 应用程序中运行它时,我没有任何问题,但是当我在工作表中运行它时,我收到此错误:object getProperty is not a member of package System。
完全相同的工作表适用于我的 Linux 机器,所以我猜它与操作系统有关?
任何帮助表示赞赏!
【问题讨论】:
-
尝试删除构建目录并重建项目。
Build | Rebuild Project如果这无助于重置 IDE 缓存。File | Invalidate Caches... | Invalidate and Restart
标签: scala intellij-idea