So I have tried the previously proposed answer to my question. but I am still having the same error message:
I am trying to load the rJava library in R
I had the same problem and, as suggested in previous comments, I manually installed the 64-bit version, selecting it here. I only had to restart R. It worked perfectly.