Scala’s primary platform is the Java Virtual Machine (JVM). (Other supported platforms: Scala.js, Scala Native.)
Sometimes new JVM and JDK (Java Development Kit) versions require us to update Scala to remain compatible.
Version compatibility table
Code, create, and learn together Code, collaborate, compile, run, share, and deploy Scala (beta) and more online from your browser Sign up to code in Scala (beta) Explore Multiplayer Collaborate in.
|JDK version||Minimum Scala versions||Recommended Scala versions|
|17||see below||see below|
|16||2.13.5, 2.12.14 (forthcoming)||2.13.5, 2.12.14 (forthcoming)|
|13, 14, 15||2.13.2, 2.12.11||2.13.5, 2.12.13|
|12||2.13.1, 2.12.9||2.13.5, 2.12.13|
|11||2.13.0, 2.12.4, 2.11.12||2.13.5, 2.12.13, 2.11.12|
|8||2.13.0, 2.12.0, 2.11.0, 2.10.2||2.13.5, 2.12.13, 2.11.12, 2.10.7|
|6, 7||2.11.0, 2.10.0||2.11.12, 2.10.7|
- C C C14 C# Java Perl PHP Python Python 3 Scala Report Bug. × Keyboard shortcuts for editor. Action Windows/Linux Mac; Run Program: Ctrl-Enter: Command-Enter.
- This Scala IDE provides dedicated support for developing pure Scala and mixed applications. Scala IDE 3.0 offers a whole host of tools and features for developers, along with a few notable bug fixes. The advanced editing tools include code completion, implicit and semantic highlighting, and an all new indent guide.
Even when a version combination isn’t listed as supported, most features may still work. (But Scala 2.12+ definitely doesn’t work at all on JDK 6 or 7.)
In general, Scala works on JDK 11+, including GraalVM, but it probably won’t take special advantage of features that were added after JDK 8. See below.
Lightbend offers commercial support for Scala. The linked page includes contact information for inquiring about supported and recommended versions.
Running versus compiling
We generally recommend JDK 8 or 11 for compiling Scala code. Since the JVM tends to be backward compatible, it is usually safe to use a newer JVM for running your code, especially if you are not using JVM features designated “experimental” or “unsafe”.
If you compile on JDK 11+ but have users on JDK 8, additional care is needed to avoid using APIs and features that don’t exist in 8. Therefore, compiling on 8 may be the safer choice. Some Scala developers use JDK 11+ for their daily work but do release builds on JDK 8.
Long Term Support (LTS) versions
After Java 8, Oracle introduced the concept of LTS versions of the JDK. These versions will remain supported (by Oracle, and likely by the rest of the ecosystem, including Scala) for longer than the versions in between. See https://www.oracle.com/technetwork/java/eol-135779.html.
JDK 8 and 11 are LTS versions. The next LTS version will be JDK 17, planned for September 2021.
Scala provides experimental support for running the Scala compiler on non-LTS versions of the JDK. The current LTS versions are normally tested in our CI matrix and by the Scala community build. We may also test non-LTS versions, but any issues found there are considered lower priority, and will not be considered release blockers. (Lightbend may be able to offer faster resolution of issues like this under commercial support.)
As already mentioned, Scala code compiled on JDK 8 should run without problems in later JVMs. We will give higher priority to bugs that break this property. (For example, later in the 2.13.x series we hope to provide support for JPMS module access checks, to ensure your code won’t incur
LinkageErrors due to module access violations.)
JDK vendors and distributions
In almost every case, you’re free to use the JDK and JVM of your choice.
JDK 8 users typically use the Oracle JDK or some flavor of OpenJDK.
Most JDK 11+ users are using either OpenJDK or GraalVM.
OpenJDK comes in various flavors, offered by different providers. We build and test Scala using AdoptOpenJDK in particular, but the differences are unlikely to matter to most users.
JDK 11 compatibility notes
Scala Ide Older Versions
Although the table above jumps from 8 to 11, JDK 9 and 10 will probably also work wherever 11 does. But unlike 9 and 10, 11 is an LTS release, so 11 is what we actually test on and recommend.
The Scala compiler does not enforce the restrictions of the Java Platform Module System, which means that code that typechecks may incur linkage errors at runtime. Scala 2.13.x will eventually provide rudimentary support for this (perhaps only in nightlies built on JDK 11).
For sbt users, JDK 11 support requires minimum sbt version 1.1.0. sbt 1.3.9 or newer is recommended. (If you are still on the 0.13.x series, use 0.13.18.)
To track progress on JDK 11 related issues, watch:
- the “Support JDK 11” issue
- the jdk11 label in scala/bug
To help with testing on JDK 11, see scala/scala-dev#559.
JDK 12, 13, 14, and 15 compatibility notes
JDK 14 was released in March 2020, and JDK 15 was released in September 2020. But 12, 13, 14, 15 are not LTS releases, so the remarks above about non-LTS releases apply. The next LTS release will be JDK 17.
JDK 12, 13, 14, and 15 are expected to work wherever JDK 11 does. The Scala community build now runs on JDK 15 (as well as 11 and 8).
As of October 2020, the jdk12 and jdk13 labels in scala/bug have no open bugs. New issues will likely be reported against the newer non-LTS jdk14 label and jdk15 label and jdk16 label or the LTS jdk11 label.
As far as we know, 12, 13, 14, and 15 are similar to 11 with respect to Scala compatibility.
JDK 16 compatibility notes
JDK 16 was released in March 2021. It is not an LTS release, so the remarks above about non-LTS releases apply. The next LTS release will be JDK 17.
The Scala community build now runs on JDK 16. We shipped improved JDK 16 support in Scala 2.13.5 and intend to ship the same improvements soon in Scala 2.12.14 (release timing thread).
JDK 17 compatibility notes
JDK 17 prereleases are already available. The final release is targeted for September 2021. JDK 17 will be an LTS release.
The Scala community build doesn’t run on JDK 17 yet. We will add it once 17 is closer to release.
The Scala 3.0.x series supports JDK 8, as well as 11 and beyond.
As Scala and the JVM continue to evolve, some eventual Scala 3.x version may drop support for JDK 8, in order to better take advantage of new JVM features. It isn’t clear yet what the new minimum supported version might become.
Contributors to this page:
Download the Scala IDE
- Download Scala IDE from link — http://scala-ide.org/download/sdk.html
- Save it in your local drive and unzip it. Then double click on the eclipse icon to start the scala ide .
Create Maven Project
Once the Scala IDE is opened then start creating first maven project. To create first project , please follow below steps.
- Click on File -> New -> Other
- Then search for Maven and select Maven project
- Check option — Create a simple project(skip archetype selection) and click on next
- Provide Group id i.e SparkTutorial and Artifact id i.e SparkTutorial
- Expand the project and open the pom.xml File and add the below content.
Once the project is updated add the scala nature to the project.
- Right click on src/main/scala and create package with package name=com.spark.scala
- Right Click on the project -> Configure -> Add Scala Nature
- Right click on package(com.spark.scala) and create a scala object i.e createRDD and copy the below code.
Right click on the code -> Run As ->Scala Application
I hope this will help you. Please feel free to comment suggestion to improve it.