Deploying to Connect when using databricks-connect

Trying to deploy to Connect and I keep getting the following error:

Error in `spark_get_java()`:
! Java is required to connect to Spark. JAVA_HOME is set to 'C:/Program Files/Java/jdk1.8.0_202' but does not point to a valid version. Please fix JAVA_HOME or reinstall from: https://www.java.com/en/
Backtrace:
 1. sparklyr::spark_connect(method = "databricks", spark_home = "path to pyspark")
 2. sparklyr:::java_is_x64()
 3. sparklyr::spark_get_java(throws = TRUE)

Quitting from lines 15-57 [spark connect] (ecomm_orders.Rmd)
Execution halted
Unable to render the deployed content: Rendering exited abnormally: exit status 1

I'm able to run the code locally so I don't know why I would be getting the Java error when deploying.

Your JAVA_HOME is set to a path that will only exist on the Windows machine you're testing. Have you seen this documentation on deploying to Connect? Deploying to Posit Connect – sparklyr

1 Like

Thanks for this - had not come across this article. I was working in Workbench before and it worked and when trying to do the same in my local machine I'd assume nothing really had to change. Appreciate it!

Thanks a lot for solution.