Support Questions
Find answers, ask questions, and share your expertise

Scalac not working in spark


Scalac command is not found when i try to run scala code in spark.


Syntax i tried : scalac test.scala


Help on how to run scala code in spark terminal or if anyother choices


Master Collaborator
scalac is not part of Spark; it is the Scala compiler. It's not clear
what you mean by "Spark terminal", but the Spark shell is not a
command line, and not something related to scalac. It is a shell where
you type code, like the Scala shell.


Yes i am using spark-shell.  


can we compile and run mutiples lines of scala code in spark shell like scalac filename  ?




New Contributor

I have the same problem.  Scalac does not seem to exist in the CDH download (even though scala does.)  I seached for scalac in the file explorere stating at the file system and the search found nothing.  How does one compile spark (.scala) programs in CDH?

Master Collaborator
You don't, in general. The cluster is where you run rather than create software. It is more like the JRE env than JDK. Lots of compiler tools aren't available and generally on purpose.


OK, So how we get to SCALAC so we can do this? Is there no faciity in Cloudera?