Giter Site home page Giter Site logo

Comments (6)

qiushiyan avatar qiushiyan commented on July 24, 2024

Thanks @hfrick for reporting this. I didn't see this error message after searching the h2o codebase. I found this function .h2o.checkJava to be used for determining java installation though, which relies on Sys.getenv('JAVA_HOME') and Sys.which('java'). After I cleaned PATH I got the error

withr::with_path(
  getwd(), 
  {
    print(c(Sys.which("java"), Sys.getenv("JAVA_HOME")))
    agua::h2o_start()
  }, 
  action = "replace"
)
#> java      
#>   ""   ""
#> Registered S3 method overwritten by 'agua':
#>   method        from     
#>   tidy.workflow workflows
#> Error in .h2o.checkJava(): Cannot find Java. Please install the latest JRE from
#> https://www.oracle.com/technetwork/java/javase/downloads/index.html

Created on 2022-11-05 with reprex v2.0.2

from agua.

hfrick avatar hfrick commented on July 24, 2024

Ah, thanks for this! So I do have java installed but I do not have JAVA_HOMEset. I put your example in a reprex and with the working directory as the path, I get the same as you. If I don't set that, as in the first part of the reprex below, it also errors but it only does so eventually. When I ran that first part interactively, I've never been patient enough to wait...

print(c(Sys.which("java"), Sys.getenv("JAVA_HOME")))
#>            java                 
#> "/usr/bin/java"              ""
agua::h2o_start()
#> Registered S3 method overwritten by 'agua':
#>   method        from     
#>   tidy.workflow workflows
#> Warning in system2(command, "-version", stdout = TRUE, stderr = TRUE): running
#> command ''/usr/bin/java' -version 2>&1' had status 1
#> Error in h2o::h2o.init(): H2O failed to start, stopping execution.

withr::with_path(
  getwd(), 
  {
    print(c(Sys.which("java"), Sys.getenv("JAVA_HOME")))
    agua::h2o_start()
  }, 
  action = "replace"
)
#> java      
#>   ""   ""
#> Error in .h2o.checkJava(): Cannot find Java. Please install the latest JRE from
#> https://www.oracle.com/technetwork/java/javase/downloads/index.html

Created on 2022-11-07 with reprex v2.0.2

from agua.

qiushiyan avatar qiushiyan commented on July 24, 2024

What is the output if you run /usr/bin/java -version from the command line? Seems this fails to locate java's version. The hanging is caused by https://github.com/h2oai/h2o-3/blob/master/h2o-r/h2o-package/R/connection.R#L217-L223 which tries to wait for 60 seconds before connection is established, agua could probabably do an early stop or add messages if previous commands fail.

from agua.

hfrick avatar hfrick commented on July 24, 2024

yup, looks like it can't locate it

 % /usr/bin/java -version
The operation couldn’t be completed. Unable to locate a Java Runtime.
Please visit http://www.java.com for information on installing Java.

an alternative to failing earlier than 60 seconds could also be telling the user that this step can take up to 60 seconds

from agua.

qiushiyan avatar qiushiyan commented on July 24, 2024

fixed by 9922d26

from agua.

github-actions avatar github-actions commented on July 24, 2024

This issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue.

from agua.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.