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

前端 未结 4 480
面向向阳花
面向向阳花 2021-01-31 13:18

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 st

4条回答
  •  渐次进展
    2021-01-31 13:49

    There are three ways to get the Scala version -

    scala> util.Properties.versionNumberString
    res103: String = 2.11.4
    
    scala> util.Properties.versionString
    res104: String = version 2.11.4
    
    scala> util.Properties.versionMsg
    res105: String = Scala library version 2.11.4 -- Copyright 2002-2013, LAMP/EPFL
    

提交回复
热议问题