21 questions
0
votes
1
answer
85
views
In Scala script, avoid "Failed to load class org.slf4j.impl.StaticLoggerBinder"
When running my Scala script, I'm seeing a warning:
> scala upload.scala
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger ...
4
votes
0
answers
215
views
How to use a private Repo with enviroment variables in a scala-cli Script
According to the scala-cli doc you can define a Repo like this:
//> using repository "https://maven-central.storage-download.googleapis.com/maven2"
And you can specify environment ...
0
votes
0
answers
105
views
Scala Script Engine is not found when run in Test using Mill or SBT
I have a strange behaviour concerning Testing Scala Script Engine.
I have the following code:
val manager = new ScriptEngineManager(getClass.getClassLoader)
val e = manager.getEngineByExtension("...
0
votes
3
answers
715
views
Ammonite: how to use another script from an Ivy dependency?
I have an Ammonite Script that I want to deliver in a JAR.
In another project I want to use this Script - but so far with no success.
I tried according to the documentation (sol_local_build.sc):
...
2
votes
1
answer
548
views
Cannot Resolve Ammonite Main Methods in Intellij
I want to use @main like described here: https://ammonite.io/#ScriptArguments
@main
def all() = {
...
}
It cannot be resolved in Intellij. I couldn't find an import. I have added these dependencies:...
11
votes
2
answers
7k
views
Scala script doesn't run on Ubuntu
I have a previously working Scala script that when I try to run it on a new PC, the compilation fails.
So I made simple script to test:
#!/bin/sh
exec scala -J-Xmx2g "$0" "$@"
!#
println("test")
...
0
votes
1
answer
162
views
how to use sbt/amm scala script on pipe operator?
I want to deal with log output with scala script. Like this:
java -jar app.jar | log.sc or java -jar app.jar | amm log.sc
How to write a log.sc deal with app.jar print logs?
motivation
Replace ...
-3
votes
2
answers
130
views
Scala language relates in some way with ScalaScript [closed]
My boss ia bashing Scala language due to an previous experience with ScalaScript from https://scala.com so are there some relationship between they?
I am trying to evagelize Scala in my company, so ...
0
votes
1
answer
108
views
Running IntelliJ scala project error
I am not using IntelliJ 15 for a long time, but never ever had such an issue. When I do: New Project -> Scala, then everything works fine, but when I do New Project -> SBT, then I can't even have main,...
0
votes
1
answer
259
views
Execute subcommand in Scala (script) and let it "take over"
I'd like to create a dummy script (with the prospect of writing a real life script) that invokes for example the Python interactive interpreter from within a Scala process and lets the user fully ...
9
votes
2
answers
2k
views
Shorter Scala Script header
It's possible to write shell scripts in Scala by starting a text file with:
#!/bin/sh
exec scala "$0" "$@"
!#
To ease script creation, I would like to write an executable called scalash (perhaps a ...