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

[BUG] Error message with Java 19 #112

Open
Robinlovelace opened this issue Dec 9, 2023 · 3 comments
Open

[BUG] Error message with Java 19 #112

Robinlovelace opened this issue Dec 9, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@Robinlovelace
Copy link
Member

Describe the bug

The following code generates an error:

library(opentripplanner)
# Path to a folder containing the OTP.jar file, change to where you saved the file.
path_data <- file.path(tempdir(), "OTP")
dir.create(path_data)
path_otp <- otp_dl_jar(version = "2.2.0")
otp_dl_demo(path_data)
# Build Graph and start OTP
log1 <- otp_build_graph(otp = path_otp, dir = path_data)

From: https://docs.ropensci.org/opentripplanner/articles/OTPv2.html

The error message is:

In otp_check_java(otp_version = otp_version) :
  OTP 2.2+ requires Java version 17 you have version 19

To Reproduce

See above.

Expected behavior

I think Java 17 should be the minimum and it should at least try to run.
Screenshots
If applicable, add screenshots to help explain your problem.

System
Please paste sessionInfo() here:

Additional context
Add any other context about the problem here.

@Robinlovelace Robinlovelace added the bug Something isn't working label Dec 9, 2023
@Robinlovelace
Copy link
Member Author

Attempting the following fix:

sudo apt install openjdk-17-jdk
# Set the version of Java to use:
sudo update-alternatives --config java

Will select 2:

sudo update-alternatives --config java
There are 3 choices for the alternative java (providing /usr/bin/java).

  Selection    Path                                         Priority   Status
------------------------------------------------------------
* 0            /usr/lib/jvm/java-19-openjdk-amd64/bin/java   1911      auto mode
  1            /usr/lib/jvm/java-11-openjdk-amd64/bin/java   1111      manual mode
  2            /usr/lib/jvm/java-17-openjdk-amd64/bin/java   1711      manual mode
  3            /usr/lib/jvm/java-19-openjdk-amd64/bin/java   1911      manual mode

@Robinlovelace
Copy link
Member Author

That worked! My guess: it would also work with Java 19 if we gave it a chance.

@mem48
Copy link
Contributor

mem48 commented Jan 6, 2024

Your probably right, OTP now seems to be racing through Java versions very quickly. Its a pain to keep up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants