title: Spark installation issue , java Exception
body: <p>When i try to run either pyspark, spark-shell, any other spark command right after installation it throws this exception.</p>
  
  <p>Please suggest a way-out its been pending since long, i have also tried installing spark through Brew, but no success.     </p>
  
  <pre><code>log4j:WARN No appenders could be found for logger (org.apache.hadoop.metrics2.lib.MutableMetricsFactory).
      log4j:WARN Please initialize the log4j system properly.
      log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
      WARNING: An illegal reflective access operation has occurred
      WARNING: Illegal reflective access by org.apache.hadoop.security.authentication.util.KerberosUtil (file:/opt/spark/lib/spark-assembly-1.6.3-hadoop2.6.0.jar) to method sun.security.krb5.Config.getInstance()
      WARNING: Please consider reporting this to the maintainers of org.apache.hadoop.security.authentication.util.KerberosUtil
      WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
      WARNING: All illegal access operations will be denied in a future release
      Exception in thread "main" java.lang.ExceptionInInitializerError
          at org.apache.hadoop.util.StringUtils.&lt;clinit&gt;(StringUtils.java:79)
          at org.apache.hadoop.security.Groups.parseStaticMapping(Groups.java:104)
          at org.apache.hadoop.security.Groups.&lt;init&gt;(Groups.java:86)
          at org.apache.hadoop.security.Groups.&lt;init&gt;(Groups.java:66)
          at org.apache.hadoop.security.Groups.getUserToGroupsMappingService(Groups.java:280)
          at org.apache.hadoop.security.UserGroupInformation.initialize(UserGroupInformation.java:271)
          at org.apache.hadoop.security.UserGroupInformation.ensureInitialized(UserGroupInformation.java:248)
          at org.apache.hadoop.security.UserGroupInformation.loginUserFromSubject(UserGroupInformation.java:763)
          at org.apache.hadoop.security.UserGroupInformation.getLoginUser(UserGroupInformation.java:748)
          at org.apache.hadoop.security.UserGroupInformation.getCurrentUser(UserGroupInformation.java:621)
          at org.apache.spark.util.Utils$$anonfun$getCurrentUserName$1.apply(Utils.scala:2214)
          at org.apache.spark.util.Utils$$anonfun$getCurrentUserName$1.apply(Utils.scala:2214)
          at scala.Option.getOrElse(Option.scala:120)
          at org.apache.spark.util.Utils$.getCurrentUserName(Utils.scala:2214)
          at org.apache.spark.SecurityManager.&lt;init&gt;(SecurityManager.scala:214)
          at org.apache.spark.repl.SparkIMain.&lt;init&gt;(SparkIMain.scala:118)
          at org.apache.spark.repl.SparkILoop$SparkILoopInterpreter.&lt;init&gt;(SparkILoop.scala:187)
          at org.apache.spark.repl.SparkILoop.createInterpreter(SparkILoop.scala:217)
          at org.apache.spark.repl.SparkILoop$$anonfun$org$apache$spark$repl$SparkILoop$$process$1.apply$mcZ$sp(SparkILoop.scala:949)
          at org.apache.spark.repl.SparkILoop$$anonfun$org$apache$spark$repl$SparkILoop$$process$1.apply(SparkILoop.scala:945)
          at org.apache.spark.repl.SparkILoop$$anonfun$org$apache$spark$repl$SparkILoop$$process$1.apply(SparkILoop.scala:945)
          at scala.tools.nsc.util.ScalaClassLoader$.savingContextLoader(ScalaClassLoader.scala:135)
          at org.apache.spark.repl.SparkILoop.org$apache$spark$repl$SparkILoop$$process(SparkILoop.scala:945)
          at org.apache.spark.repl.SparkILoop.process(SparkILoop.scala:1059)
          at org.apache.spark.repl.Main$.main(Main.scala:31)
          at org.apache.spark.repl.Main.main(Main.scala)
          at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
          at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.base/java.lang.reflect.Method.invoke(Method.java:566)
          at org.apache.spark.deploy.SparkSubmit$.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:731)
          at org.apache.spark.deploy.SparkSubmit$.doRunMain$1(SparkSubmit.scala:181)
          at org.apache.spark.deploy.SparkSubmit$.submit(SparkSubmit.scala:206)
          at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:121)
          at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)
      Caused by: java.lang.StringIndexOutOfBoundsException: begin 0, end 3, length 2
          at java.base/java.lang.String.checkBoundsBeginEnd(String.java:3319)
          at java.base/java.lang.String.substring(String.java:1874)
          at org.apache.hadoop.util.Shell.&lt;clinit&gt;(Shell.java:49)
          ... 35 more
      Using Spark's repl log4j profile: org/apache/spark/log4j-defaults-repl.properties
      To adjust logging level use sc.setLogLevel("INFO")## Heading ##
  </code></pre>