Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I get the Scala version from within Scala itself?

Tags:

version

scala

This is not about command-line compiler options. How do I programmatically obtain the Scala version inside code?

Alternatively, where does the Eclipse Scala plugin v2 store the path to scalac?

like image 352
mlvljr Avatar asked May 25 '11 08:05

mlvljr


People also ask

How do I find Scala version?

Check Scala Version Using scala CommandWrite 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.

How do I know if Scala is installed on Linux?

Type scala -version in your terminal. If the output shows that Scala 2.11. 1 (or higher) is installed, then you are done.

How do I download Scala for Windows?

Scala is a very compatible language and thus can very easily be installed into the Windows. The most basic requirement is that we must have Java 1.8 or a greater version installed on our computer. Verifying Java Packages: The first thing we need to have is a Java Software Development Kit(SDK) installed on the computer.


1 Answers

This will work without access to scala-compiler.jar:

Welcome to Scala version 2.9.1.final (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_26). Type in expressions to have them evaluated. Type :help for more information.  scala> util.Properties.versionString res0: java.lang.String = version 2.9.1.final 
like image 194
Paul Butcher Avatar answered Sep 19 '22 03:09

Paul Butcher