From a4c1d7eb1938ea8a9e922f8cdb9e6199619af00f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20V=C3=B6lkle?= Date: Wed, 11 Oct 2023 13:38:08 +0200 Subject: [PATCH] fix java_check if runtime missing (#37) --- R/selenium.R | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/R/selenium.R b/R/selenium.R index 106a335..027c050 100644 --- a/R/selenium.R +++ b/R/selenium.R @@ -142,6 +142,10 @@ java_check <- function() { if (identical(unname(javapath), "")) { stop("PATH to JAVA not found. Please check JAVA is installed.") } + java_version <- suppressWarnings(system2(Sys.which("java"), "-version", stdout = TRUE, stderr = TRUE)) + if (!is.null(attr(java_version, "status"))) { + stop(paste(java_version, collapse = "\n")) + } javapath }