Using the controlling interface with NetLogo on windows

69 views Asked by At

Can someone render assistance with invoking net logo on Windows. This works on Linux fine, but taking the example code from (https://github.com/NetLogo/NetLogo/wiki/Controlling-API) I get the following. It initially appears to be something with the java CLASSPATH but that is solved with the -cp arg, why it cannot pick from the environemnt I do not understand, but then I cannot run it. Please help.

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

Finally passing the class path as an arg gets it to complile.

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

But running produces more errors.

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
0

There are 0 answers