For `java`, the classpath can't come after the main class. Switch your
call to `java -classpath "D:\NetLogo\NetLogo.jar" Example3`.
Jason Bertsche
Senior Software Developer - NetLogo
On 1/17/2014 12:07 AM, [email protected] wrote:
I tried compiling and running the example code at
https://github.com/NetLogo/NetLogo/wiki/Controlling-API (Example 3). The code compiles
but when I try to run it (with the command `java Example3 -classpath
"D:\NetLogo\NetLogo.jar"`), a NoClassDefFoundError occurs:
D:\NetLogo>java Example3 -classpath "D:\NetLogo\NetLogo.jar"
Exception in thread "main" java.lang.NoClassDefFoundError:
org/nlogo/lite/InterfaceComponent
at Example3.main(Example3.java:6)
Caused by: java.lang.ClassNotFoundException: org.nlogo.lite.InterfaceComponent
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 1 more
How can I resolve this issue? I really don't get classpaths. I compilied with the command
`javac Example3.java -classpath "D:\NetLogo\NetLogo.jar"`.
--
You received this message because you are subscribed to the Google Groups
"netlogo-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.