You cannot use a different major version of Scala (2.9, 2.10) than your 'NetLogo.jar' was built against. If you're using the 'NetLogo.jar' that comes with the standard distribution of NetLogo that you get from the NetLogo website, it runs with Scala 2.9, and your program should also be built against 2.9 and load up a 2.9 version of the Scala standard library when it runs. If you're using a 'NetLogo.jar' that was built using a recent snapshot of NetLogo's 'master' or 'headless' branches, you'll want to use a 2.10 version of Scala.

My guess is that you're probably depending on the 'NetLogo.jar' from the NetLogo distribution, so you'd then want a 2.9 version of Scala. I don't use Scala IDE, so I don't know the specifics of making the errors go away in your IDE, but, in IntelliJ, it would consist of adding Scala 2.9 as a global library, setting the compiler in the Scala facet for the project to use that Scala 2.9 global library, and also adding that Scala 2.9 library to the project's classpath. I imagine that the Scala IDE steps are similar. You just have to make the language version settings all line up.

Jason Bertsche
Senior Software Developer - NetLogo

On 12/28/2013 03:24 PM, Robert White wrote:

I am using Scala Eclipse IDE and I get the following errors while running the code at: https://github.com/NetLogo/NetLogo/wiki/Controlling-API

I searched online. It seems that is caused by version 2.9.x is not comparable with 2.10.x?

Do any other people get the same errors? If I remove the Scala library and use the library provided by Netlogo then the IDE would report errors. So I am really running into a bit problem that I can't solve the problem either way.

Thanks very much!

Robert ;)

//--------the following is the error message ------

Exception in thread "main" java.lang.NoClassDefFoundError: scala/reflect/ClassManifest

at org.nlogo.api.Version$.<init>(Version.scala:15)

at org.nlogo.api.Version$.<clinit>(Version.scala)

at org.nlogo.headless.HeadlessWorkspace$.newInstance(HeadlessWorkspace.scala:38)

at org.nlogo.headless.HeadlessWorkspace$.newInstance(HeadlessWorkspace.scala:31)

at Example2$.main(Example.scala:26)

at Example2.main(Example.scala)

Caused by: java.lang.ClassNotFoundException: scala.reflect.ClassManifest

at java.net.URLClassLoader$1.run(URLClassLoader.java:366)

at java.net.URLClassLoader$1.run(URLClassLoader.java:355)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(URLClassLoader.java:354)

at java.lang.ClassLoader.loadClass(ClassLoader.java:424)

at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)

at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

--
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.

--
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.

Reply via email to