0

I am new to Java. I am using System.getenv("SPARK_HOME") to get the spark home path in given machine. When the Java application runs on ubuntu machine it gives null. The above property is set in bashrc (did source .bashrc). Tested through echo $SPARK_HOME which prints the value and also with printenv |grep SPARK_HOME.

I referred this answer, but it dint help to solve my problem.

Sunil Rao
  • 800
  • 2
  • 6
  • 23

1 Answers1

1

Before running the jar run the following command:

$ source ~/.bashrc

$ java -jar myJar.java
Ömer Erden
  • 7,680
  • 5
  • 36
  • 45