Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setup_r5() function does not run. #372

Closed
adelfave opened this issue Feb 22, 2024 · 3 comments
Closed

setup_r5() function does not run. #372

adelfave opened this issue Feb 22, 2024 · 3 comments

Comments

@adelfave
Copy link

Hi there,

Brief description of the problem:

Whenever I try to run the function: setup_r5(), I receive the following error: "Error in setup_r5(data_path = data_path) :
This package requires the Java SE Development Kit 11.
Please update your Java installation. The jdk 11 can be downloaded from either:

Reproducible example here

# insert reproducible example here

library(r5r)

# build transport network
data_path <- system.file("extdata/poa", package = "r5r")
r5r_core <- setup_r5(data_path = data_path, temp_dir = TRUE) # This is the part in your tutorial that provides me with the error.

# load origin/destination points
points <- read.csv(file.path(data_path, "poa_hexgrid.csv"))


### Situation report here
```r
r5r::r5r_sitrep()
r5r::r5r_sitrep()
$r5r_package_version
[1] ‘1.1.0$r5_jar_version
character(0)

$java_version
[1] "21.0.2"

$set_memory
[1] "-Xmx2G"

$session_info
R version 4.3.2 (2023-10-31 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 11 x64 (build 22621)

Matrix products: default


locale:
[1] LC_COLLATE=English_United States.utf8 
[2] LC_CTYPE=English_United States.utf8   
[3] LC_MONETARY=English_United States.utf8
[4] LC_NUMERIC=C                          
[5] LC_TIME=English_United States.utf8    

time zone: America/Halifax
tzcode source: internal

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] rJava_1.0-11      osmextract_0.5.0  ggplot2_3.4.4    
[4] data.table_1.15.0 sf_1.0-15         r5r_1.1.0        

loaded via a namespace (and not attached):
 [1] vctrs_0.6.5        httr_1.4.7         cli_3.6.2         
 [4] rlang_1.1.3        DBI_1.2.2          KernSmooth_2.23-22
 [7] generics_0.1.3     glue_1.7.0         backports_1.4.1   
[10] colorspace_2.1-0   e1071_1.7-14       scales_1.3.0      
[13] fansi_1.0.6        grid_4.3.2         munsell_0.5.0     
[16] classInt_0.4-10    tibble_3.2.1       lifecycle_1.0.4   
[19] compiler_4.3.2     dplyr_1.1.4        Rcpp_1.0.12       
[22] pkgconfig_2.0.3    rstudioapi_0.15.0  R6_2.5.1          
[25] class_7.3-22       tidyselect_1.2.0   utf8_1.2.4        
[28] curl_5.2.0         pillar_1.9.0       magrittr_2.0.3    
[31] checkmate_2.3.1    withr_3.0.0        tools_4.3.2       
[34] proxy_0.4-27       gtable_0.3.4       units_0.8-5     
@rafapereirabr
Copy link
Member

Hi. Thanks for opening this issue. If you read the output of r5r::r5r_sitrep(), you will see that R is not detectiong you Java JDK v11, bus instead it detects v21.

$java_version
[1] "21.0.2"

The easiest solution here would be to install the dev version of {r5r}, which uses JDK 21. You can do this with the code below. Please let me know if this works for you.

  utils::remove.packages('r5r')
  devtools::install_github("ipeaGIT/r5r", subdir = "r-package")

@iamchrisearle
Copy link

Thank you @rafapereirabr, this worked for me.

@rafapereirabr
Copy link
Member

ok, closing this issue for now. We can reopen it if the problem persists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants