1

有人可以协助在 Windows 上调用网络徽标吗?这在 Linux 上运行良好,但从(https://github.com/NetLogo/NetLogo/wiki/Controlling-API)获取示例代码我得到以下信息。它最初似乎是 java CLASSPATH 的东西,但是用 -cp arg 解决了,为什么它不能从我不理解的环境中选择,但后来我无法运行它。请帮忙。

c:\Program Files\NetLogo 5.3.1\app>echo %CLASSPATH%

"C:\Program Files\NetLogo 5.3.1\app\NetLogo.jar;."

c:\Program Files\NetLogo 5.3.1\app>javac \Users\robert\Documents\example1.java
\Users\robert\Documents\example1.java:1: error: package org.nlogo.app does not e
xistimport org.nlogo.app.App;
                    ^
\Users\robert\Documents\example1.java:4: error: cannot find symbol
    App.main(argv);
    ^
  symbol:   variable App
  location: class Example1
\Users\robert\Documents\example1.java:10: error: cannot find symbol
              App.app().open(
              ^
  symbol: variable App

\Users\robert\Documents\example1.java:17: error: cannot find symbol
      App.app().command("set density 62");
      ^
  symbol:   variable App
  location: class Example1

\Users\robert\Documents\example1.java:18: error: cannot find symbol
      App.app().command("random-seed 0");
      ^
  symbol:   variable App
  location: class Example1
\Users\robert\Documents\example1.java:19: error: cannot find symbol
      App.app().command("setup");
      ^
  symbol:   variable App
  location: class Example1

\Users\robert\Documents\example1.java:20: error: cannot find symbol
      App.app().command("repeat 50 [ go ]");
      ^
  symbol:   variable App
  location: class Example1

\Users\robert\Documents\example1.java:22: error: cannot find symbol
        App.app().report("burned-trees"));
        ^
  symbol:   variable App
  location: class Example1

8 errors

最后将类路径作为 arg 传递可以编译。

c:\Program Files\NetLogo 5.3.1\app>javac -cp %CLASSPATH% \Users\robert\Documents
\example1.java

但是运行会产生更多错误。

c:\Program Files\NetLogo 5.3.1\app>java \Users\robert\Documents\Example1.java
Fel: Kan inte hitta eller kan inte ladda huvudklassen \Users\robert\Documents\Ex
ample1.java
4

0 回答 0