Unable to install package tabulizerjars, and load related package rJava.

I am trying to install the package tabulizerjars so I can install and run tabulizer. I need to use this library to run extract_text().
I have tried to install the package manually using the tar.gz file, I have also tried to install it from git hub

Manual installation
install.packages("other files/tabulizer_0.2.2.tar.gz", repos = NULL, type = "source")

github installation
install_github("ropensci/tabulizerjars")

I have been able to install the rJava package, but can not load it.
Attached is the image of the error I get

I have tried to set the JAVA path as well (C:\Program Files (x86)\Java\jre1.8.0_321\bin). But not able to load the library (may be I have set the path wrong).

When I try and install the tabulizerjars package, below is the error I get.

The version of R I am using is in the image below
R_version

I have installed both 32 and 64 bit JRE, I am still not able to install/load these packages

Thanks in advance.

PS: For context, this is on my official laptop, which was changed recently. I have had to go through installing all my libraries again.

To set JAVA_HOME, add a line like this to your Renviron.site file with the actual Java version you have installed and restart your R session.

JAVA_HOME="C:/Program Files/Java/jdk-11.0.1/"

Have in mind that since you are executing a 64-bit version of R, you have to set a path to a 64-bit bit version of Java

I tried this, it did not solve the problem.

If you keep getting the same error message then you haven't set your JAVA_HOME environment variable correctly.

It is hard to help you any further if you do not provide more detailed information on what exactly you have tried.

So a step by step beyond what I have indicated in my original question.

  1. Installed JDK, JRE (both 32 and 64 bit)
  2. Installed rJava library, which installed successfully
  3. On trying to load rJava so that I can install tabulizerjars and subsequently tabulizer, I am not able to load rJava

I have not explicitly set any path variables in windows for JRE and JDK

I have another question, do I need to set paths for both JRE and JDK explicitly (for both 32 and 64 bit) or setting path to one of them is sufficient?
Error I am getting is

Error: package or namespace load failed for ‘rJava’:
 .onLoad failed in loadNamespace() for 'rJava', details:
  call: inDL(x, as.logical(local), as.logical(now), ...)
  error: unable to load shared object 'C:/Users/SESA651314/Documents/R/win-library/4.1/rJava/libs/x64/rJava.dll':
  LoadLibrary failure:  The specified module could not be found.

Please let me know if you are looking for any exact details

You need to set it at least for the R version you are executing.

You haven't tell us exactly how you are setting your JAVA_HOME environment variable. Have you added a line like the one I told you to the Renviron.site file located at C:/Program Files/R/R-4.1.2/etc/? (note that it is not C:\Program Files (x86)). Can you show us the content of this file?

Hey,

Sorry for the delayed response over the weekend.

I did add a line similar to what you have indicated in the Renviron.site file. When that did not work, this is what solved my problem.

I uninstalled JRE (both 32 and 64 bit)
The installed

  1. JDK (32 and 64 bit)
  2. JRE again (32 and 64 bit)

in that order (i.e., JDK first, then JRE. Not sure if the order matters though)

But after doing this rJava was able to load and I was able to install the other two packages as well.
From my understanding, the issue was not installing JDK and only installing JRE. This is because once I installed JDK, with out explicitly adding any path variables (either in windows global variables, or Renviron.site) the rJava worked and my other packages also installed.

Not sure if that was a coincidence, or that solved the issue (If anyone can clarify if my assumption is right or wrong that would be great for me and for others in the same situation).
I will only be able to validate this the next time I go through reinstalling R and all the libraries.

Thanks for your help @andresrcs :+1:.

SystemRequirements: Java JDK 1.2 or higher (for JRI/REngine JDK 1.4 or higher), GNU make

Documentation only specifies a JDK install so I don't know about the JRE, maybe you just where defining the wrong path and reinstalling automatically set a correct one for you on an environment variable.

Thank you for clarifying this.
Looks like the error was installing JRE instead of JDK .
Installing of JDK seems have fixed the path issues like you mentioned.

Thanks again @andresrcs

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.