Critical Error Occurs when Booting Up R …“jvm.dll” is missing! Can't use libraries any more

雨燕双飞 提交于 2020-03-23 07:12:32

问题


I have a critical problem which has effectively halted my R programming environment. I need the Java integration and rJava library as I use the R program in many other packages, and they specify this library as a prerequisite ( Rapidminer, SAP Predictive analytics etc). It used to work, I don't know what happened!. Please assist.

  1. When I boot up R it comes up with:

    . The message says " its Header is: rsession.exe- System error , the body says:

    "the program can't start because jvm.dll is missing from your computer. Try re-installing the program to fix this problem".

    What program (referred to in the message) must I re-install and where must I install it to?

  2. I have installed and reinstalled r ( version3.2.1)[2] ..see second image ( I am using R studio ( Version 0.99893))

    ![enter image description here][2]

  3. I also deleted and re-installed the java library rJava , and it installs but wont load i.e. library(rJava)..results in the same error message as in 1 above and when I press OK to continue the console brings up the following text :

ERROR MESSAGE IN R CONSOLE WHEN USING "library(rJava)"

"library("rJava", lib.loc="~/R/win-library/3.2")
 Error : .onLoad failed in loadNamespace() for 'rJava', details:
 call: inDL(x, as.logical(local), as.logical(now), ...)
 error: unable to load shared object 'C:/Users/grbortz/
 Documents/R/win-library/3.2/rJava/libs/x64/rJava.dll':
  LoadLibrary failure:  The specified module could not be found.

In addition: Warning message:

package ‘rJava’ was built under R version 3.2.5
Error: package or namespace load failed for ‘rJava’

However when I Look in my directory as it mentioned above i.e. the rJava.dll path mentioned above, i.e. ~ " Users\ grbortz\ Documents /R/ winlibrary /3.2/rJava/libs / x64 / rJava.dll

The rJava.dll file is there!

Please help. If any more actons are needed from my side I am happy to oblige.


回答1:


R-studio is looking for the 'jvm.dll' file in a location where it does not exist. You probably might have a 64bit R studio installed and it's looking in the 32bit java folder. Try to find where the 64bit version of java is and inside there you will have the jvm.dll. on my machine this jvm.dll file is in

  • "C:\Program Files\Java\jre7\bin\server".

Once found, all you have to do is point to where the java "jre7" folder resides and RStudio would automatically look inside it for jvm.dll. You can point it with the following command

Sys.setenv(JAVA_HOME='C:\\Program Files\\Java\\jre7').




回答2:


  • In RStudio type .LibPaths()
  • This will give you a path in you windows system where your libraries are located
  • Go there and delete rJava. If it is being used by applications of Java, kill all Java programs in the Task Manager.

  • Go to computer and properties, click on change environment variables

  • Edit JAVA_HOME to the path where your newest installation of Java is located and save.



回答3:


First check if Java version is installed in the specified folder:

C:\Program Files\Java\jre7\

in my case, the newest java version was in the following path:

C:\Program Files (x86)\Java\jre1.8.0_181

so I changed the path in advanced system settings -> Environment Variables -> JAVA_HOME

then R studio message stopped




回答4:


Check if you have a system environment variable called "JAVA_HOME" that points to a wrong or non-existent directory. This may happen after JRE was updated. Edit the environment variable to point to the correct directory (e.g., "C:\Program Files\Java\jre1.8.x_xxx").




回答5:


I have been dealing with this problem for several hours. I finally figured it out. My advice to you;

  • First, check your Java version and the folder where it is installed
    from the Control Panel.
  • If R is 64 bit, it should be 64 bit in Java. Please check.
  • You must enter the path of the Java you learned in the environment variables. As the figure below.

I added it to "Java Home" and neglected the bottom one (PATH) so it didn't happen. You need to make changes to the environment variables in two places. As the figure below. One of them is to add and add a semicolon in the PATH or update it if it already exists. I updated it. Problem solved. Good luck.



来源:https://stackoverflow.com/questions/40523439/critical-error-occurs-when-booting-up-r-jvm-dll-is-missing-cant-use-libr

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!