# How to choose scala version that gatling use ?

**URL:** <https://community.gatling.io/t/how-to-choose-scala-version-that-gatling-use/2635>\
**Category:** Gatling (Open-Source)\
**Created:** [October 23, 2015, 9:40am UTC](https://community.gatling.io/t/how-to-choose-scala-version-that-gatling-use/2635 "2015-10-23T09:40:19Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Terejima\_Ryoko](https://avatars.discourse-cdn.com/v4/letter/t/9de053/32.png) [@Terejima\_Ryoko](https://community.gatling.io/u/Terejima_Ryoko)\
**Post date:** [October 23, 2015, 9:40am UTC](https://community.gatling.io/t/how-to-choose-scala-version-that-gatling-use/2635/1 "2015-10-23T09:40:19Z")

</div>

Hi.

I want to use gatling maven plugin 2.1.7 for my project.  
I read this to add gatling in maven :  
[http://gatling.io/docs/2.1.7/extensions/maven\_plugin.html?highlight=plugin](http://gatling.io/docs/2.1.7/extensions/maven_plugin.html?highlight=plugin)

When I run gatling:execute I have this error :

`  
[INFO] — gatling-maven-plugin:2.1.7:execute (default) @ zenith-portal-webui —  
Downloading: [http://zenith-sf/nexus/content/groups/public/org/scala-lang/scala-library/2.10.4/scala-library-2.10.4.jar](http://zenith-sf/nexus/content/groups/public/org/scala-lang/scala-library/2.10.4/scala-library-2.10.4.jar)  
Downloading: [http://zenith-sf/nexus/content/groups/public/com/typesafe/zinc/zinc/0.3.5.3/zinc-0.3.5.3.jar](http://zenith-sf/nexus/content/groups/public/com/typesafe/zinc/zinc/0.3.5.3/zinc-0.3.5.3.jar)  
Downloaded: [http://zenith-sf/nexus/content/groups/public/com/typesafe/zinc/zinc/0.3.5.3/zinc-0.3.5.3.jar](http://zenith-sf/nexus/content/groups/public/com/typesafe/zinc/zinc/0.3.5.3/zinc-0.3.5.3.jar) (384 KB at 495.6 KB/sec)  
Downloaded: [http://zenith-sf/nexus/content/groups/public/org/scala-lang/scala-library/2.10.4/scala-library-2.10.4.jar](http://zenith-sf/nexus/content/groups/public/org/scala-lang/scala-library/2.10.4/scala-library-2.10.4.jar) (6960 KB at 762.6 KB/sec)  
java.lang.reflect.InvocationTargetException  
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)  
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)  
at java.lang.reflect.Method.invoke(Method.java:483)  
at io.gatling.mojo.MainWithArgsInFile.runMain(MainWithArgsInFile.java:50)  
at io.gatling.mojo.MainWithArgsInFile.main(MainWithArgsInFile.java:33)  
Caused by: java.lang.reflect.InvocationTargetException  
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)  
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)  
at java.lang.reflect.Method.invoke(Method.java:483)  
at sbt.compiler.RawCompiler.apply(RawCompiler.scala:26)  
at sbt.compiler.AnalyzingCompiler$$anonfun$compileSources$1$$anonfun$apply$2.apply(AnalyzingCompiler.scala:147)  
at sbt.compiler.AnalyzingCompiler$$anonfun$compileSources$1$$anonfun$apply$2.apply(AnalyzingCompiler.scala:142)  
at sbt.IO$.withTemporaryDirectory(IO.scala:285)  
at sbt.compiler.AnalyzingCompiler$$anonfun$compileSources$1.apply(AnalyzingCompiler.scala:142)  
at sbt.compiler.AnalyzingCompiler$$anonfun$compileSources$1.apply(AnalyzingCompiler.scala:139)  
at sbt.IO$.withTemporaryDirectory(IO.scala:285)  
at sbt.compiler.AnalyzingCompiler$.compileSources(AnalyzingCompiler.scala:139)  
at sbt.compiler.IC$.compileInterfaceJar(IncrementalCompiler.scala:33)  
at com.typesafe.zinc.Compiler$.compilerInterface(Compiler.scala:148)  
at com.typesafe.zinc.Compiler$.create(Compiler.scala:53)  
at io.gatling.compiler.ZincCompiler$delayedInit$body.apply(ZincCompiler.scala:115)  
at scala.Function0$class.apply$mcV$sp(Function0.scala:40)  
at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12)  
at scala.App$$anonfun$main$1.apply(App.scala:71)  
at scala.App$$anonfun$main$1.apply(App.scala:71)  
at scala.collection.immutable.List.foreach(List.scala:318)  
at scala.collection.generic.TraversableForwarder$class.foreach(TraversableForwarder.scala:32)  
at scala.App$class.main(App.scala:71)  
at io.gatling.compiler.ZincCompiler$.main(ZincCompiler.scala:35)  
at io.gatling.compiler.ZincCompiler.main(ZincCompiler.scala)  
… 6 more  
Caused by: java.lang.NoClassDefFoundError: scala/collection/GenTraversableOnce$class  
at scala.reflect.io.AbstractFile.(AbstractFile.scala:91)  
at scala.reflect.io.PlainFile.(PlainFile.scala:34)  
at scala.reflect.io.AbstractFile$.getDirectory(AbstractFile.scala:47)  
at scala.reflect.io.AbstractFile$.getDirectory(AbstractFile.scala:36)  
at scala.tools.nsc.settings.MutableSettings$OutputDirs.setSingleOutput(MutableSettings.scala:270)  
at scala.tools.nsc.settings.MutableSettings$OutputSetting.value\_$eq(MutableSettings.scala:545)  
at scala.tools.nsc.settings.MutableSettings$OutputSetting.(MutableSettings.scala:542)  
at scala.tools.nsc.settings.MutableSettings.OutputSetting(MutableSettings.scala:221)  
at scala.tools.nsc.settings.ScalaSettings$class.$init$(ScalaSettings.scala:64)  
at scala.tools.nsc.settings.MutableSettings.(MutableSettings.scala:19)  
at scala.tools.nsc.Settings.(Settings.scala:12)  
at scala.tools.nsc.Driver.process(Driver.scala:39)  
at scala.tools.nsc.Main.process(Main.scala)  
… 31 more  
Caused by: java.lang.ClassNotFoundException: scala.collection.GenTraversableOnce$class  
at java.net.URLClassLoader$1.run(URLClassLoader.java:372)  
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)  
at java.security.AccessController.doPrivileged(Native Method)  
at java.net.URLClassLoader.findClass(URLClassLoader.java:360)  
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)  
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)  
… 44 more

`

I read on some topics that galting 2.1.X need scala 2.11.X.  
I don’t understand why it automatically download scala 2.10 on the nexus while version 2.11.7 is on our nexus.

[![](https://lh3.googleusercontent.com/-aP8YFh6MRac/VioAd1wo9_I/AAAAAAAAACg/YkXRznSCNH8/s320/nexus.png)](https://lh3.googleusercontent.com/-aP8YFh6MRac/VioAd1wo9_I/AAAAAAAAACg/YkXRznSCNH8/s1600/nexus.png)

How can I choose the version of scala that gatling will use ?

---

<div class="post-metadata">

**Author:** ![aidylewis](https://avatars.discourse-cdn.com/v4/letter/a/e9a140/32.png) [@aidylewis](https://community.gatling.io/u/aidylewis)\
**Post date:** [October 23, 2015, 10:19am UTC](https://community.gatling.io/t/how-to-choose-scala-version-that-gatling-use/2635/2 "2015-10-23T10:19:18Z")

</div>

I can see the sbt compiler in that stacktrace which needs Scala 2.10.x If set Gatling should compile on 2.11.x

---

<div class="post-metadata">

**Author:** ![slandelle](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/slandelle/32/4_2.png) [@slandelle](https://community.gatling.io/u/slandelle)\
**Post date:** [October 23, 2015, 10:37am UTC](https://community.gatling.io/t/how-to-choose-scala-version-that-gatling-use/2635/3 "2015-10-23T10:37:10Z")

</div>

Please have a look at the demo project: [http://github.com/gatling/gatling-maven-plugin-demo](http://github.com/gatling/gatling-maven-plugin-demo)

---

<div class="post-metadata">

**Author:** ![Pierre\_DAL-PRA](https://avatars.discourse-cdn.com/v4/letter/p/ecccb3/32.png) [@Pierre\_DAL-PRA](https://community.gatling.io/u/Pierre_DAL-PRA)\
**Post date:** [October 23, 2015, 11:20am UTC](https://community.gatling.io/t/how-to-choose-scala-version-that-gatling-use/2635/4 "2015-10-23T11:20:55Z")

</div>

Gatling is built on Scala 2.11, but the compiler itself runs on Scala 2.10.

---

<div class="post-metadata">

**Author:** ![Terejima\_Ryoko](https://avatars.discourse-cdn.com/v4/letter/t/9de053/32.png) [@Terejima\_Ryoko](https://community.gatling.io/u/Terejima_Ryoko)\
**Post date:** [October 23, 2015, 1:50pm UTC](https://community.gatling.io/t/how-to-choose-scala-version-that-gatling-use/2635/5 "2015-10-23T13:50:41Z")

</div>

I download the example project and I have the same error when I run “mvn gatling:execute -Dgatling.simulationClass=computerdatabase.BasicSimulation”.

---

<div class="post-metadata">

**Author:** ![Terejima\_Ryoko](https://avatars.discourse-cdn.com/v4/letter/t/9de053/32.png) [@Terejima\_Ryoko](https://community.gatling.io/u/Terejima_Ryoko)\
**Post date:** [October 23, 2015, 2:55pm UTC](https://community.gatling.io/t/how-to-choose-scala-version-that-gatling-use/2635/6 "2015-10-23T14:55:37Z")

</div>

I delete all the dependencies to keep only gatling-charts-highcharts and now it works.  
I think there was a conlict between some dependencies.

---

<div class="post-metadata">

**Author:** ![slandelle](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/slandelle/32/4_2.png) [@slandelle](https://community.gatling.io/u/slandelle)\
**Post date:** [October 24, 2015, 11:05am UTC](https://community.gatling.io/t/how-to-choose-scala-version-that-gatling-use/2635/7 "2015-10-24T11:05:07Z")

</div>

The demo’s only dependency is gatling-highcharts.  
I suspect you had conflicting versions of gatling or scala-library.
