title: What is the difference between running a java/scala program via Intellij/Eclipse and running a jar
body: <p>My code works fine if I "Run As" a scala program but when I create a jar file and run it there are some issues.</p>
  
  <p>Can anyone guide how I go about trouble shooting it. It is a spark streaming code connecting to a kafka service.</p>
  
  <pre><code>object Test {
  
    def main(args: Array[String]): Unit = {
  
      val batchInterval = 5
  
      val conf = new SparkConf()
        .setAppName("test")
        .setMaster("local[2]")
        .set("spark.serializer", "org.apache.spark.serializer.KryoSerializer")
  
      val sc = new SparkContext(conf)
      sc.setLogLevel("ERROR")
  
      val ssc = new StreamingContext(sc, Seconds(batchInterval))
  
      ssc.receiverStream(
        ReceiverFactory.createReceiver(
            "host-name",
            "end-point",
            "stream-name",
            classOf[JsonNode],
            batchInterval
          )
        )
        .map(_.getPayload.toString)
        .foreachRDD(rdd =&gt; println("*** getting a count of RDD " + rdd.count()))
  
  
      ssc.start()
      ssc.awaitTermination
    }
  }
  </code></pre>