Skip to content

Commit 939e417

Browse files
committed
remove lookbehinds in java_check_version_system
1 parent f250a74 commit 939e417

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

R/java_env.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,8 +331,8 @@ java_check_version_system <- function(
331331

332332
# extract Java version
333333
java_ver_string <- java_ver[[1]]
334-
matches <- gregexpr('(?<=\\b(?:openjdk|java) version \")[0-9]{1,2}', java_ver_string, perl = TRUE)
335-
major_java_ver <- regmatches(java_ver_string, matches)[[1]]
334+
matches <- regexec('(openjdk|java) (version )?(\\\")?([0-9]{1,2})', java_ver_string)
335+
major_java_ver <- regmatches(java_ver_string, matches)[[1]][5]
336336

337337
# fix 1 to 8, as Java 8 prints "1.8"
338338
if (major_java_ver == "1") {

0 commit comments

Comments
 (0)