1

All using OSX

Due to issues with conda Rstudio and not installing rgraphviz. I decided to fresh install Rstudio and just use it. Everything appeared to work finely until I tried to use RJDBC to access my database.

It worked fine when connected with anaconda but alone, I receive the following error

library(RJDBC)

PathDriver = "~/driver/hsqldb.jar"
JDBCDriver = "org.hsqldb.jdbcDriver"
drv <- JDBC(JDBCDriver,PathDriver)

WARNING: Initial Java 12 release has broken JNI support and does NOT work. Use stable Java 11 (or watch for 12u if avaiable).

I looked up my current java version in the terminal

(base):$ java -version

openjdk version "1.8.0_152-release"
OpenJDK Runtime Environment (build 1.8.0_152-release-1056-b12)
OpenJDK 64-Bit Server VM (build 25.152-b12, mixed mode)

confusing but either way I try to update to java 11 and reset the java R is using

brew cask install java11

and the java version still reads as java 1.8.0

Going into R, I still receive the error above. How do I fix this so I can use Java 11 in R?

1 Answer 1

2

You need to run

R CMD javareconf

in the terminal to get R and Java in sync.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for the reply. I found that R kept configuring to the Java installed with anaconda. I uninstalled anaconda, used sdkman to install java 14 and now ran the command you provided. Now everything appears to work

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.