Skip to content

Commit

Permalink
add java version check
Browse files Browse the repository at this point in the history
  • Loading branch information
tpetrychyn committed Jun 23, 2020
1 parent a3fecd5 commit 1cfb0e2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {
}

group = "org.example"
version = "0.1.1-SNAPSHOT"
version = "0.1.1"

repositories {
mavenCentral()
Expand Down
9 changes: 9 additions & 0 deletions src/main/kotlin/controllers/CacheChooserController.kt
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,15 @@ class CacheChooserController @Inject constructor(

@FXML
private fun initialize() {
val javaVer = System.getProperty("java.version")
val majorVer = javaVer.split(".")[0].toInt()
if (majorVer < 11) {
lblErrorText.isVisible = true
lblErrorText.text = "Java version detected ($javaVer) is too low, please update Java to at least version 11."
btnLaunch.isDisable = true
return
}

val listCachesPlaceholder = Label("No downloadable caches found.")
listCachesPlaceholder.isWrapText = true
listCachesPlaceholder.textAlignment = TextAlignment.CENTER
Expand Down

0 comments on commit 1cfb0e2

Please sign in to comment.