ipeaGIT/r5r

The package displays a message that Java 11 is required, although Java 21 is installed

wacekk opened this issue · 3 comments

wacekk commented

I'm trying to implement the example from https://ipeagit.github.io/r5r/articles/isochrones.html. I have the necessary packages installed. My Java version is:

> rJava::.jcall("java.lang.System", "S", "getProperty", "java.version")
[1] "21.0.1"

Unfortunately, an error occurred when I entered the function setup_r5. I have the latest Java SE Development Kit 21 installed in my system, according to the website: https://github.com/ipeaGIT/r5r

> setup_r5(data_path)
Error in 'setup_r5(data_path)' command:
   This package requires the Java SE Development Kit 11.
Please update your Java installation. The jdk 11 can be downloaded from either:
   - openjdk: https://jdk.java.net/java-se-ri/11
   - oracle: https://www.oracle.com/java/technologies/javase-jdk11-downloads.html


Is it possible to solve this problem without installing version 11, which is no longer supported?

Hi @wacekk ,

It looks like you are using the stable version of r5r available from CRAN. I assume you installed the package with command install.packages("r5r"), right? The stable version of r5r only works with Java JDK 11, as explained in the documentation.

We are currently working on a new released that works with the JDK 21 and uses the latest version of R5. We're planning to pulbish the new release in the next couple of months. In the meantime, you can install and use the dev version of r5r, see below.

# remove current version
utils::remove.packages('r5r')

# install dev version
devtools::install_github("ipeaGIT/r5r", subdir = "r-package")
wacekk commented

Thank you. You're right. After installing the development version, the example works.

A small note, when calling function r5r_core <- setup_r5(data_path) there is an error:

Downloading R5 jar file to C:\Users\XXX\AppData\Local/R/cache/R/r5r/r5-v7.0-all.jar
2023-12-22 19:38:39,573 [main] ERROR c.c.r.s.StreetLayer - Continuing to load but ignoring generalized costs due to exception: java.lang.RuntimeException: All ways are expected to have generalized cost tags. Missing: slope_1:forward

Finished building network.dat at C:/Users/XXX/AppData/Local/R/win-library/4.3/r5r/extdata/poa/network.dat

But the example works fine. Thank you for your help. I am further analyzing the possibility of using the package in my work.

Thanks. R5 prints some error messages that we cannot silience from R, but this should work fine. Closing the issue for now.