我正在參加一個在線課程,并被指示將一組練習作為一個專案匯入到 IDEA 中。構建和重建專案后,我無法運行這些類。有一個單獨的入門課程,向您展示如何完成所有這些操作,并且效果很好,所以我不確定出了什么問題。
沒有選項可以運行該類
入門專案運行良好
我已經比較了 build.project 檔案,我看到了錯誤: 課程主專案中的錯誤
我收到一條關于我在運行時無法解決的問題的訊息
sbt 版本
在我的專案目錄中:
PS M:\School\Scala Applied Part 1> cd .\exercises-applied\
PS M:\School\Scala Applied Part 1\exercises-applied> sbt sbtVersion
WARNING: A terminally deprecated method in java.lang.System has been called
WARNING: System::setSecurityManager has been called by sbt.TrapExit$ (file:/C:/Users/*/.sbt/boot/scala-2.12.4/org.scala-sbt/sbt/1.1.0/run
_2.12-1.1.0.jar)
WARNING: Please consider reporting this to the maintainers of sbt.TrapExit$
WARNING: System::setSecurityManager will be removed in a future release
[info] Loading project definition from M:\School\Scala Applied Part 1\exercises-applied\project
error: error while loading String, class file '/modules/java.base/java/lang/String.class' is broken
(class java.lang.NullPointerException/Cannot invoke "scala.tools.nsc.Global$Run.typerPhase()" because the return value of "scala.tools.nsc.Gl
obal.currentRun()" is null)
我好像找不到
/modules/java.base/java/lang/String.class
在檔案結構中,我不知道如何更新它。
uj5u.com熱心網友回復:
build.sbt 需要在根目錄下。我已經更改了專案的根目錄,它構建得很好。謝謝馬特烏斯!
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/398131.html