Netlogo and MXJ – java compiling issues

Sep 21, 2011 at 7:43am

Netlogo and MXJ – java compiling issues

Hi there,

I’m trying to create an mxj object to run and query Netlogo Models
in max.

Using the Netlogo Example code ((http://ccl.northwestern.edu/netlogo/docs/) I’m trying to open Netlogo from max and run the commands as a simple test. Unfortunately, I’m having problems compiling (see below). I’ve included all the relevant jar files from max and Netlogo (as instructed on the website) in the classpath and am building directly to the Cycling ’74/java/classes directory.

I’m new to java so this is proving quite difficult.
Any advice to help me started would be much appreciated.

Best

J
[System: OSX 10.6.8 / Max 5.1.8 / Netlogo 4.1.3 / Java 1.6]

Code:
——

import com.cycling74.max.*;
import org.nlogo.app.App;

public class Example1 extends MaxObject {

public static void main(String[] argv) {
App.main(argv);
try {
java.awt.EventQueue.invokeAndWait
( new Runnable()
{ public void run() {
try {
App.app.open
(“models/Sample Models/Earth Science/”
+ “Fire.nlogo”);
}
catch( java.io.IOException ex ) {
ex.printStackTrace();
}
} } );
App.app.command(“set density 62″);
App.app.command(“random-seed 0″);
App.app.command(“setup”);
App.app.command(“repeat 50 [ go ]“);
System.out.println
(App.app.report(“burned-trees”));
}
catch(Exception ex) {
ex.printStackTrace();
}
}
}

MXJ Compile Window error:
————————-

javac: invalid flag: /Applications/Max5/Cycling ’74/java/classes/Example1
Usage: javac


use -help for a list of possible options
[ Sep 21, 2011 4:30:39 PM ]
compilation of /Applications/Max5/Cycling ’74/java/classes/Example1 failed

#58965
May 21, 2012 at 7:53pm

Did you ever figure this out? just found out about netlogo and it seems it could be a powerful combo…

#211829

You must be logged in to reply to this topic.