# Scala signature predef has wrong version

**URL:** <https://community.gatling.io/t/scala-signature-predef-has-wrong-version/8331>\
**Category:** Gatling (Open-Source)\
**Created:** [September 29, 2023, 2:33am UTC](https://community.gatling.io/t/scala-signature-predef-has-wrong-version/8331 "2023-09-29T02:33:00Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![trinp](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/trinp/32/1593_2.png) [@trinp](https://community.gatling.io/u/trinp)\
**Post date:** [September 29, 2023, 2:33am UTC](https://community.gatling.io/t/scala-signature-predef-has-wrong-version/8331/1 "2023-09-29T02:33:00Z")

</div>

Hi, currently I’m trying to build a Gatling Project by using SBT, I have tried out 2 versions of scala that are 2.13.12 and 2.12.18. Here is my build.sbt:

```auto
enablePlugins(GatlingPlugin)
libraryDependencies += "io.gatling.highcharts" % "gatling-charts-highcharts" % "3.9.0" % "test"
libraryDependencies += "io.gatling" % "gatling-test-framework" % "3.9.0" % "test"

```

plugins.sbt:

```auto
addSbtPlugin("io.gatling" % "gatling-sbt" % "4.5.0")

```

Hit compile will cause me the error that returns

```auto
java.io.IOException: Scala signature Predef has wrong version
expected: 5.0o / Test / compileIncremental 6s
found: 5.2 in Predef.class
...
...
...
[error] error while loading Predef, class file 'dir\gatling-core\3.9.0\gatling-core-3.9.0.jar(io/gatling/core/Predef.class)' is broken  
[error] (class java.lang.RuntimeException/error reading Scala signature of Predef.class: Scala signature Predef has wrong version
[error] expected: 5.0
[error] found: 5.2 in Predef.class)

```

I did some research, but there are not much about this behavior and I know that there is a library version conflicted, but I’m not sure what exactly the version of the Gatling I should use to fit with scala 2.12 and 2.13. Can I have a suggestion ?

---

<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:** [September 29, 2023, 5:46am UTC](https://community.gatling.io/t/scala-signature-predef-has-wrong-version/8331/2 "2023-09-29T05:46:03Z")

</div>

> java.io.IOException: Scala signature Predef has wrong version  
> expected: 5.0o / Test / compileIncremental 6s  
> found: 5.2 in Predef.class

This error message means you’re trying to compile with Scala 2.12 but Gatling 3.9 requires Scala 2.13.

---

<div class="post-metadata">

**Author:** ![trinp](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/trinp/32/1593_2.png) [@trinp](https://community.gatling.io/u/trinp)\
**Post date:** [September 29, 2023, 6:46am UTC](https://community.gatling.io/t/scala-signature-predef-has-wrong-version/8331/3 "2023-09-29T06:46:36Z")

</div>

Hi @slandelle , thank you for your help, just a suggestion that if we are going to use plugin, there should be a brief scala compatible on website.  
After changing the version on sbt, I have finished compiling and it runs smoothly, but however it returns as this:

```auto
[info] No tests to run for Gatling / testOnly

```

I believe I had put the directories followed the default tree as [Gatling - SBT Plugin](https://gatling.io/docs/gatling/reference/current/extensions/sbt_plugin/) mentioned (_src/test/scala_), and here is my project tree, compiling using _Gatling / testOnly (dir).testReqres_

```auto
project
 - plugins.sbt
src
 - test
   - scala
     - testReqres.scala
build.sbt
target

```

Is there anything that I am lacking from the build ?

---

<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:** [September 29, 2023, 6:59am UTC](https://community.gatling.io/t/scala-signature-predef-has-wrong-version/8331/4 "2023-09-29T06:59:07Z")

</div>

> _Gatling / testOnly (dir).testReqres_

Does your simulation inside the Scala file properly match the file name? Do you really have `class testReqres extends Simulation` in there?  
What’s this `(dir).` in your command? The parameter must be a Java fully qualified class name (package + class simple name), not the path of the file (they don’t necessarily match if you don’t follow the convention).

---

<div class="post-metadata">

**Author:** ![trinp](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/trinp/32/1593_2.png) [@trinp](https://community.gatling.io/u/trinp)\
**Post date:** [September 29, 2023, 7:04am UTC](https://community.gatling.io/t/scala-signature-predef-has-wrong-version/8331/5 "2023-09-29T07:04:33Z")

</div>

Thank you for pointing out, I forgot to change the class name

```auto
class testReqres extends Simulation

```

The `(dir).` was a `*.` but the HTML read it as bold, and I don’t put package, so the correct command was

```auto
Gatling / testOnly testReqres

```

The false one (the one I found on some random page, not on this one)

```auto
Gatling / testOnly *.testReqres

```

Thank you again, mr.Landelle.

---

<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:** [September 29, 2023, 7:11am UTC](https://community.gatling.io/t/scala-signature-predef-has-wrong-version/8331/6 "2023-09-29T07:11:05Z")

</div>

At this point, I don’t know if things now work for you or not.  
If they don’t, I’m afraid I can’t help. I recommend that you check the official sample: [GitHub - gatling/gatling-sbt-plugin-demo: Showcase of the Gatling Plugin for SBT](https://github.com/gatling/gatling-sbt-plugin-demo)

Then, as you’re struggling with Scala, sbt and this third party plugin for gRPC, please note that we’re about to release an official gRPC plugin available on Gatling Enterprise. It will support Java and Kotlin, and maven and gradle. It would be way easier to set up than what you’re currently struggling with.

---

<div class="post-metadata">

**Author:** ![trinp](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/trinp/32/1593_2.png) [@trinp](https://community.gatling.io/u/trinp)\
**Post date:** [September 29, 2023, 7:17am UTC](https://community.gatling.io/t/scala-signature-predef-has-wrong-version/8331/7 "2023-09-29T07:17:54Z")

</div>

I am truly sorry if I cause the trouble for you guys these days, but my team demands on Scala and sbt is a must so I could not convince them to change, since there will be a large portion in project changing too.  
There are some good progress here and there, hopefully I can code them in so that I won’t make a fuss more.

---

<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:** [September 29, 2023, 7:20am UTC](https://community.gatling.io/t/scala-signature-predef-has-wrong-version/8331/8 "2023-09-29T07:20:44Z")

</div>

Honestly, migrating from Gatling Scala to Gatling Java is pretty easy.  
And you can also consider contracting with us to have us do it for you.

---

<div class="post-metadata">

**Author:** ![system](https://europe1.discourse-cdn.com/flex013/uploads/gatling2/original/2X/b/b148e0742de35c6280726cabf3ecd3de2d320f63.png) [@system](https://community.gatling.io/u/system)\
**Post date:** [October 29, 2023, 7:21am UTC](https://community.gatling.io/t/scala-signature-predef-has-wrong-version/8331/9 "2023-10-29T07:21:28Z")

</div>

Closed on October 29, 2023, 7:21am UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
