Is it possible to check spark installation or spark version through Java Code?
Please provide any suggestions.
Is it possible to check spark installation or spark version through Java Code?
Please provide any suggestions.
I'm not sure but this might work:classOf[SparkContext].getPackage.getImplementationVersion
for more information check out programmatic-way-to-tell-Spark-version
Hope it helps
TL;DR It'd be a very tough programming assignment if possible at all.
You'd have to implement find
-like Java application to search for files like jars/spark-core_*-*.jar
and even that would not be an exhaustive search as one could install Spark with a complete rename of everything Spark comes with.
You could also search for some environment variables like SPARK_HOME
, but since that's not required to use Spark effectively either, I would not count on that.