problems with install in R on Linux with openjdk-9

76 views
Skip to first unread message

Luzie Ursula Wingen

unread,
Feb 28, 2018, 12:43:34 PM2/28/18
to Core Hunter Users
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

Herman De Beukelaer

unread,
Mar 5, 2018, 2:21:11 PM3/5/18
to Core Hunter Users
Hi Luzie,

Thanks for reporting this issue. It is due to the new version-string scheme that has been introduced with Java 9. Full details are provided here: http://openjdk.java.net/jeps/223. I was unaware of this until now.

I have added a fix similar as yours to java.R and will soon deploy a new version of Core Hunter to CRAN, so that the package is fully compatible with Java 9.

Thanks a lot!
Herman

Herman De Beukelaer

unread,
Apr 18, 2018, 1:56:53 PM4/18/18
to Core Hunter Users
Hi all,

We have deployed an update of Core Hunter, version 3.2.1, to CRAN. It should fix install problems with Java 9 (and Java 10, which has also been released in the meantime).

Luzie, could you perhaps verify whether you can install the new version properly on your computer?

Thanks
Herman
Reply all
Reply to author
Forward
0 new messages