Search code examples
rrstudiorjdbc

RStudio crashes when running JDBC() function in the RJDBC package


Whenever I try to make a JDBC object:

jdbcDriver <- JDBC(driverClass="oracle.jdbc.OracleDriver", 
               classPath="~/ojdbc6.jar")

My RStudio immediately crashes with no warning with this popup

enter image description here

However, the code works perfectly in the terminal R environment outside of RStudio, so I am certain it is an RStudio issue.

OS: Mac OS High Sierra 10.13.6

latest version of RStudio (1.1.456) and R (3.5.1).

JDK version 1.8.0_191

Using ojdbc6.jar


Solution

  • I set JAVA_HOME in my terminal, but somehow it didn't "work" for RStudio.

    So the fix was that I created an .Renviron file and put the following inside:

    JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_191.jdk/Contents/Home

    That did the trick