File tree Expand file tree Collapse file tree 1 file changed +3
-12
lines changed
presentation-compiler/test/dotty/tools/pc/utils Expand file tree Collapse file tree 1 file changed +3
-12
lines changed Original file line number Diff line number Diff line change @@ -3,20 +3,11 @@ package dotty.tools.pc.utils
33object JRE :
44
55 def getJavaMajorVersion : Int =
6- val javaVersion = sys.env.get(" java.version" ).filter(! _.isEmpty())
6+ val javaVersion = sys.env.get(" java.specification. version" ).filter(! _.isEmpty())
77
88 javaVersion match
99 case Some (version) if version.startsWith(" 1.8" ) => 8
10- case _ =>
11- scala.util.Try :
12- val versionMethod = classOf [Runtime ].getMethod(" version" )
13- versionMethod.nn.setAccessible(true )
14- val version = versionMethod.nn.invoke(null )
15-
16- val majorMethod = version.getClass().getMethod(" feature" )
17- majorMethod.nn.setAccessible(true )
18- val major = majorMethod.nn.invoke(version).asInstanceOf [Int ]
19- major
20- .getOrElse(8 ) // Minimal version supported by Scala
10+ case Some (version) => version
11+ case None => 8
2112
2213
You can’t perform that action at this time.
0 commit comments