'R, java version error in sparklyr spark_connect

I do not understand this error or how to bypass it, any help would be appreciated.

library(sparklyr)
spark_install(version = "3.0.0")
sc <- spark_connect(master = 'local')

Error: Java 11 is only supported for Spark 3.0.0+

The thing is I have Java Version 8 Update 261 and I have updated my environment variables appropriately, so I am unsure of what exactly is going on.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source