There are some solutions here
Windows Spark Error java.lang.NoClassDefFoundError: Could not initialize class org.apache.spark.storage.StorageUtils
The mentioned error probably corresponds to the following exception:
java.lang.IllegalAccessError: class org.apache.spark.storage.StorageUtils$ (in unnamed module @0x12a94400) cannot access class sun.nio.ch.DirectBuffer (in module java.base) because module java.base does not export sun.nio.ch to unnamed module
Switching back to Java 11 or below is not a solution for me. How can this be solved with Java 17?
You can solve this problem (and about each and every Java 17 problem) by adding a --add-exports statement to the corresponding Java call. In this case --add-exports java.base/sun.nio.ch=ALL-UNNAMED.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With