How to Check Scala Version in Scala

Mohammad Irfan Feb 02, 2024
  1. Check Scala Version Using scala Command
  2. Check Scala Version Using versionString Command
  3. Check Scala Version Using versionNumberString Command
  4. Check Scala Version Using versionMsg Command
How to Check Scala Version in Scala

In this tutorial, we will discuss how to check the version of Scala on the local computer. Here, we use Ubuntu operating system and its terminal, and you can apply these commands to any Operating System.

Check Scala Version Using scala Command

Write the scala command to your terminal and press enter. After that, it opens Scala interpreter with a welcome message and Scala version and JVM details.

Output:

Check Scala Version Using scala Command

Check Scala Version Using versionString Command

This is another command of Scala that prints the version string to the console. Make sure you execute this command after entering into the Scala interpreter.

It prints the version, including the minor series number.

Output:

Check Scala Version Using versionString Command

Check Scala Version Using versionNumberString Command

Scala provides a versionNumberString command with the same function as the versionString command. The difference between the two is the format of the result.

Output:

Check Scala Version Using versionNumberString Command

Check Scala Version Using versionMsg Command

If you want to get more information than just version number, use the versionMsg command that returns a complete message such as Scala library version, copyright info with the year, and the LAMP info.

Output:

Check Scala Version Using versionMsg Command