Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to make private java.nio.DirectByteBuffer(long,int) accessible

I'm using Python to access Databricks through databricks-connect. Behind the wall, this uses spark which is indeed java based so in order to use this, I need java. The JDK has been downloaded (version 14), set as JAVA_HOME env but when I run the code, I get the following error:

Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make private java.nio.DirectByteBuffer(long,int) accessible: module java.base does not "opens java.nio" to unnamed module @bccb269

This is the code where it crashes

from pyspark.sql import SparkSession
spark = SparkSession.builder.getOrCreate()

I googled but couldn't find this error, I don't think it's the first time occurring to me. Any ideas what this error means and how can I fix it?

like image 281
anthino12 Avatar asked Feb 24 '26 15:02

anthino12


1 Answers

Databricks Runtimes and databricks-connect won't work with Java 14. Only DBR 10.x have an experimental support for Java 11, but I doubt that it's supported for databricks-connect.

You need to install Java 8 to use databricks-connect.

like image 52
Alex Ott Avatar answered Feb 26 '26 04:02

Alex Ott



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!