Hi all,
Not a real question any more, as I found a solution, but I thought I flag it up if anyone else has trouble.
I tried to install under R version 3.4.3 (2017-11-30) under Ubuntu Linux and openjdk-9.
The command:
> install.packages(’corehunter’)
came back with:
Error: package or namespace load failed for "corehunter":
.onLoad failed in loadNamespace() for ’corehunter’, details:
call: if (version < req.version) {
error: missing value where TRUE/FALSE needed
Error: loading failed
After some investigation why that would happen, I found that the function "java.version"
in script "java.R" returned an NA value, as the string of the java version was constructed
differently from expected:
> version.string <- J("java.lang.System")$getProperty("java.version")
> version.string
[1] "9-internal"
The expectation is <somestring>.<versionnumber>
I changed java.R to fit my version:
# ------------------ #
# GENERAL JAVA STUFF #
# ------------------ #
java.version <- function(){
version.string <- J("java.lang.System")$getProperty("java.version")
if(grepl('[.]',version.string))
version <- as.integer(strsplit(version.string, ".", fixed = TRUE)[[1]][2])
else ### crude fix by Luzie as Java version of JDK 9 is different
version <- as.integer(strsplit(version.string, "-", fixed = TRUE)[[1]][1])
return(version)
}
and the installation then ran smoothly.
Cheers
Luzie