"找不到 JAVA 的路径.请检查是否安装了 JAVA."初始化RSelenium时出错 [英] "PATH to JAVA not found. Please check JAVA is installed." error when initialising RSelenium

查看:26
本文介绍了"找不到 JAVA 的路径.请检查是否安装了 JAVA."初始化RSelenium时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试启动一个到 webscrape 的 RSelenium 会话.但是,在运行此代码时:

I am trying to start an RSelenium session to webscrape. However, when running this code:

driver <- rsDriver(browser=c("chrome"), chromever="76.0.3809.126", port = 4444L)

我收到此错误:java_check() 中的错误:找不到 JAVA 的路径.请检查JAVA是否安装.

我已经安装了正确版本的 Java - 我想我需要在 R 中设置 Java 的路径,但我不知道如何做到这一点.我是一名数据科学家,不了解任何计算机的工作原理.

I have installed the right version of Java - I think I somehow need to set the path to Java in R, but I've got no idea how to do this. I'm a data scientist and don't understand how any of the computer stuff works.

我还尝试安装 Docker 以在本教程之后修复此问题:

I also tried to install Docker to fix this following this tutorial:

https://callumgwtaylor.github.io/blog/2018/02/01/using-rselenium-and-docker-to-webscrape-in​​-r-using-the-who-蛇数据库/

但是当按照要求在终端中运行此代码时,我得到:'docker' 不被识别为内部或外部命令、可运行的程序或批处理文件.

but when running this code in the terminal as requested I get:'docker' is not recognized as an internal or external command, operable program or batch file.

有人可以帮忙吗?

谢谢

推荐答案

或者,您可以手动运行二进制文件.在您的操作系统中打开一个控制台并导航到二进制文件所在的位置并运行:

Alternatively, you can run the binary manually. Open a console in your OS and navigate to where the binary is located and run:

java -jar selenium-server-standalone-x.xx.x.jar

java -jar selenium-server-standalone-x.xx.x.jar

这篇关于&quot;找不到 JAVA 的路径.请检查是否安装了 JAVA."初始化RSelenium时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆