0

这是我的代码

 def main(args: Array[String]): Unit = {
    val engine = new RobocodeEngine
    def rounds = 1
   val battlefield = new BattlefieldSpecification(1000, 500)
   //val robots = engine.getLocalRepository()
   engine.setVisible(true)

   // val obs = new BattleObserver
    //engine.addBattleListener(obs)
    //val battleSpec = new BattleSpecification(rounds, battlefield, robots)
    //engine.runBattle(battleSpec, true)
    //engine.close()
    //System.exit(0)

  }

这是 setVisible 引发的错误(但它与 getLocalRepository 的行为相同

Exception in thread "Application Thread" java.lang.ClassCircularityError: net/sf/robocode/host/security/RobocodeSecurityPolicy$2
at net.sf.robocode.host.security.RobocodeSecurityPolicy.implies(RobocodeSecurityPolicy.java:101)
at java.security.ProtectionDomain.implies(ProtectionDomain.java:272)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:344)
at java.security.AccessController.checkPermission(AccessController.java:560)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
at java.lang.System.setProperty(System.java:781)
at net.sf.robocode.ui.WindowManager.setEnableGUI(WindowManager.java:104)
at net.sf.robocode.ui.WindowManager.setVisibleForRobotEngine(WindowManager.java:622)
at robocode.control.RobocodeEngine.setVisible(RobocodeEngine.java:196)
at main.ScalaBot$.main(main.scala:11)
at main.ScalaBot.main(main.scala)

我应该在哪里寻找循环?

4

0 回答 0