Here's a brief overview the landscape of Java-dependent R packages and user issues with them (solution is rJavaEnv): https://www.ekotov.pro/rJavaEnv/articles/why-rJavaEnv.html
Getting issues with Java, because one or more of you R packages depend on it? If you see your package on the list (see attached pic), rJavaEnv is here to help you to install Java properly with one command. Even if you are just reading xlsx files with xlsx package (though you probably should switch to readxl...), you may be affected.