Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unbreak sbt.ScriptMain #122

Closed
dwijnand opened this issue Jan 18, 2016 · 5 comments · Fixed by #160
Closed

Unbreak sbt.ScriptMain #122

dwijnand opened this issue Jan 18, 2016 · 5 comments · Fixed by #160
Labels

Comments

@dwijnand
Copy link
Owner

The changes around JAVA_HOME and setting javaHome in #95 broke sbt.ScriptMain.

See #95 (comment)

@dwijnand
Copy link
Owner Author

I propose removing all the logic around setting javaHome as I've found http://www.jenv.be/ to be a better solution.

Among other things this would solve #99.

@dwijnand
Copy link
Owner Author

dwijnand commented Jul 2, 2016

Here's an example scala script (using sbt.ScriptMain), after #142:

#!/usr/bin/env sbt -script

/***
scalaVersion := "2.11.8"
*/

println(scala.util.Properties.versionNumberString)

@dwijnand
Copy link
Owner Author

dwijnand commented Jul 2, 2016

The above script doesn't work with current master, provided you have a JAVA_HOME set:

$ export JAVA_HOME=$(/usr/libexec/java_home -v 1.8)
$ ./shout.scala
[info] Loading global plugins from /Users/dnw/.dotfiles/.sbt/0.13/plugins
java.io.FileNotFoundException: /s/warn (No such file or directory)
    at java.io.FileInputStream.open0(Native Method)

@paulp
Copy link
Collaborator

paulp commented Jul 3, 2016

As a rule, shebang lines like

#!/usr/bin/env sbt -script

don't work. It makes the whole endeavor a giant pain. See some discussion at stackoverflow. You cannot rely on being able to pass more than one argument to env.

@dwijnand
Copy link
Owner Author

dwijnand commented Jul 3, 2016

Oh wonderful..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants