Running an uber jar from sbt assembly results in error: Could not find or load main class
问题 I have a spark job packaged as an uber-jar using the sbt assembly plugin. The build.sbt specifies a runnable main to be the target of the resulting uber-jar mainClass in assembly := Some("com.foo.Bar") After the assembly is correctly created, running the intended command: java -jar assembly.jar results in Error: Could not find or load main class com.foo.Bar Using the an alternative method, like java -cp assembly.jar com.foo.Bar gives the same error message. Then, I extracted the contents of