pg2455
pg2455

Reputation: 5148

Invalid or corrupt sbt-launch-jar file

I have been trying to install spark on my MacOSX. I have already installed Scala and Sbt using brew. After downloading and untarring the spark-1.4.1 (i have also tried spark-1.2.1 and spark-1.1.1) I am running -

sbt/sbt clean assembly 

Everytime its the same error:

Invalid or corrupt jarfile sbt/sbt-launch-0.13.5.jar

I have tried above mentioned solutions of changing the name and manually installing sbt, but none of those seems to work. I have seen people asking questions on stackoverflow lot of times and solution does not seem to be consistent. Can some one help me here?

Upvotes: 3

Views: 5134

Answers (2)

prabeesh
prabeesh

Reputation: 945

In the build/sbt-launch-lib.bash edit correspond line with following

if [ $(command -v curl) ]; then
  (curl --fail --location --silent ${URL1} > ${JAR_DL} ||\
   (rm -f "${JAR_DL}" && curl --fail --location --silent ${URL2} ${JAR_DL})) && \
   mv "${JAR_DL}" "${JAR}"
elif [ $(command -v wget) ]; then
  (wget --quiet ${URL1} -O ${JAR_DL} ||\
   (rm -f "${JAR_DL}" && wget --quiet ${URL2} -O ${JAR_DL})) &&\
    mv "${JAR_DL}" "${JAR}"
else

Then try again, run the sbt assembly command

sbt/sbt assembly

Upvotes: 1

Dean Wampler
Dean Wampler

Reputation: 2151

Yikes. If you look at the contents of this "jar" file, it's actually an HTML 404 document. I'll report a bug.

If you decide to build a distribution, the Maven build is better maintained (obviously!). I use the SBT build only for "playing around" and then I just use my brew-installed SBT, not the this one that's bundled (bungled more like it...).

UPDATE: the build script build/sbt is supposed to download the jar file on demand. I think someone built the tgz file with this bogus HTML file, without checking it first. I'm investigating and I'll file a bug report.

In the mean time, just delete the build/sbt-launch-0.13.7.jar and try running build/sbt again (sbt/sbt is obsolete and just calls build/sbt).

UPDATE2: Crap, deleting the file doesn't help. I was mistaken that the bogus jar file is included. I think the URLs are bad that it attempts to read from. Stand by...

FINAL UPDATE: The good news is this bug is fixed for 1.5. For now, just download http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt-launch/0.13.7/sbt-launch.jar, move it to the build directory, and rename it sbt-launch-0.13.7.jar. Then build/sbt will work.

Upvotes: 16

Related Questions