Skip to content

Commit

Permalink
fix java version parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
arksap2002 committed Sep 4, 2023
1 parent d2349c2 commit 55dcdc0
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,15 @@ class EvoSuiteProcessManager(
try {
if (processStopped(project, indicator)) return

if (!project.service<TestCoverageCollectorService>().runCommandLine(arrayListOf(settingsApplicationState!!.javaPath, "-version")).contains("version \"11")) {
val regex = Regex("version \"(.*?)\"")
val version = regex.find(project.service<TestCoverageCollectorService>().runCommandLine(arrayListOf(settingsApplicationState!!.javaPath, "-version")))
?.groupValues
?.get(1)
?.split(".")
?.get(0)
?.toInt()

if (version == null || version > 11) {
evoSuiteErrorManager.errorProcess(TestSparkBundle.message("incorrectJavaVersion"), project)
return
}
Expand Down

0 comments on commit 55dcdc0

Please sign in to comment.