dopatraman
dopatraman

Reputation: 13908

Getting 'Invalid or Corrupt jar file' error upon running sbt

I'm trying to run sbt but I'm getting this error:

Error: Invalid or corrupt jarfile /bin

This is what I've done so far:

I've placed my sbt-launch.jar file inside the /bin folder and created a file sbt with the following line:

java -Xmx512M -jar `dirname $0`/sbt-launch.jar "$@"

Then I run sudo chmod u+x sbt

Now, when I run sudo sbt I get the error.

Error: Invalid or corrupt jarfile /bin

Please help. What am I doing wrong?

Upvotes: 1

Views: 3917

Answers (1)

0__
0__

Reputation: 67280

It somehow disconnects the dirname macro and the concatenation with /sbt-launch.jar.

  • Make sure there is not an accidental white space between the two
  • You could also try to hardcode the path, i.e. use -jar /bin/sbt-launch.jar

Upvotes: 2

Related Questions