Scala-library-2.13.6.jar(scala/reflect/package.class)' is broken

Hi Forum,

I am trying to install Scala 2.12 as mentioned in the instructions, but I am unable to install it.

I am using IntelliJ IDEA Community Edition:

IntelliJ IDEA 2023.1.4 (Community Edition)

Build #IC-231.9225.16, built on July 12, 2023

Runtime version: 17.0.7+10-b829.16 aarch64

VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.

macOS 13.4.1

GC: G1 Young Generation, G1 Old Generation

Memory: 2048M

Cores: 10

Metal Rendering is ON

Kotlin: 231-1.8.21-IJ9225.16

Is there a way you can help me install scala, so I can continue with the example.

When trying to run “Engine.scala” from the example., to get the following error:

scalac: error while loading package, class file ‘/Users/Test/.m2/repository/org/scala-lang/scala-library/2.13.6/scala-library-2.13.6.jar(scala/reflect/package.class)’ is broken

(class java.lang.RuntimeException/error reading Scala signature of package.class: Scala signature package has wrong version

expected: 5.0

found: 5.2 in package.class)

Here is a screenshot of the Scala Library versions installed

From IDE, I get the version that can be installed is 2023.1.19


You mention “the instructions” and “the example”, but what instructions and what example…?

apologize for that. Here is the location of what I am following:

That page requires sign-in, so I (and probably others) are unable to view it.

It’s possible we might be able to help you regardless, but we’d need more details about how your project is set up.

The error message seems to indicate a mix of Scala 2.12 and 2.13 in your project configuration. You say you’re trying to use 2.12, but the error message shows that Scala 2.13.6 has become involved somehow.

Note that in general, you don’t need to “install” Scala. You specify a Scala version in an IDE or build tool, and the IDE or build tool downloads that Scala version for you as needed.

Hi @SethTisue Regarding sign-in I am adding the picture for you to get the idea of what lesson I am trying to follow:

this is a lesson from the Gatling Academy - All available load testing courses

I removed the Scala Plugin, and now getting Error: Could not find or load main class Engine


and this picture to show the Scala version.

The error says Could not find or load main class but the Engine.scala is put in src/test/scala. InteliJ assumes a structured directory layout. Probably moving it to src/main/scala should allow to run main. However, I might be wrong. I’m mostly a VSCode + Metals user and I run stuff from terminal with commands

This picture shows a different error message than the one you originally asked about. Did the original error go away?

The “Gatling prerequisites” slide you included says “Java JDK - version 8 or 11”, but your most recent screen shot seems to show that you are using JDK 20.