sbt / sbt-launcher-package

Packaging for sbt so you can run it.
http://scala-sbt.org/download.html
Apache License 2.0
89 stars 92 forks source link

Using sbt in Windows 10 WSL #238

Closed HongyiFu closed 5 years ago

HongyiFu commented 6 years ago

So I've been trying to use sbt in Windows WSL, but I couldn't get it to work. I have sbt installed in windows (not in WSL).

C:\Users\User>bash
fuhy@MyPC:/mnt/c/Users/User$ cd Desktop/play/foo-build/
fuhy@MyPC:/mnt/c/Users/User/Desktop/play/foo-build$ sbt
Error: Unable to access jarfile /mnt/c/Program Files (x86)/sbt/bin/sbt-launch.jar

It seems to be an issue of space escaping in "Program Files (x86)". I also read on SO that java -jar could be the issue? link

Reading the bashscript, it seems that the variable $jar_file is put in double quotes so the spaces should be correctly parsed (based on my very limited bash knowledge)?

My question is:

  1. Could it be that my setup is wrong?
  2. Does SBT support WSL? SBT works perfectly from cmd on my machine.
  3. What is the right way to setup SBT? Install in both Windows and WSL?

p/s: I had zero knowledge in bash script (i.e. things like variable/functions in bash etc) prior to encountering this. I did try my best to read through bash tutorials in order to get this to work. Any help would be much appreciated!!

eed3si9n commented 6 years ago

Could you try installing sbt within Windows Subsystem for Linux (WSL) by following https://www.scala-sbt.org/release/docs/Installing-sbt-on-Linux.html?

er1c commented 5 years ago

This can be closed, simply install sbt via apt-get. More details in https://github.com/sbt/sbt-launcher-package/issues/253

shaansheikh commented 5 years ago

Install on windows subsystem for linux using the following commands

echo "deb https://dl.bintray.com/sbt/debian /" | sudo tee -a /etc/apt/sources.list.d/sbt.list  
curl -sL "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2EE0EA64E40A89B84B2DF73499E82A75642AC823" | sudo apt-key add  
sudo apt-get update  
sudo apt-get install sbt

These are the instructions from the Linux SBT installation instructions, but the second command has been substituted to get around a WSL bug

eed3si9n commented 5 years ago

I am closing this for now.