mlvljr mlvljr - 1 year ago 77
Scala Question

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

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


Answer Source

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

Welcome to Scala version (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
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download