Questions tagged [scala-repl]
40 questions
0
votes
1 answer
Error double literal found in Scala while executing jar tf command
I have recently started learning Scala. I am trying to execute the tf jar command on spark -shell prompt
jar tf C:/spark/lib/spark-examples-1.6.0-hadoop2.6.0.jar
And it's throwing error
error: ';' expected but double literal found.
Could someone…

Sam
- 3
- 1
0
votes
1 answer
Scala REPL: Can I run a piece of code at every start?
Just like bash invokes .bashrc every time it starts, can scala REPL do the similar thing?

wangt0907
- 227
- 1
- 9
0
votes
1 answer
How many Scala REPLs can live in one JVM?
I have noticed that there can be two scala REPL in one JVM and you can even connect a Scala REPL remotely to a running JVM. So I was just wondering, how many REPLs can you have in one JVM, and what is it bounded by?

uh_big_mike_boi
- 3,350
- 4
- 33
- 64
0
votes
3 answers
How to inject custom object into scala repl when initializing scala repl
I'd like to custom the scala repl by injecting some custom value when starting scala repl. What kind of api that I can use for that ? Any difference between scala 2.10 and 2.11 ? Thanks

zjffdu
- 25,496
- 45
- 109
- 159
0
votes
1 answer
sbt task to start Scala REPL with project's classes on the classpath and some initial commands
I want to define an sbt task that would start the scala console with project's compiled classes on the classpath and some initial commands executed.
I want to start that REPL session like this
sbt session
Here is my sorry attempt that I put…

Tomas Mikula
- 6,537
- 25
- 39
-1
votes
1 answer
Running scala in cmd makes i look like I am missing 'build.sbt'
I'm trying to run Scala in my command line.
I checked my java, went to the Scala website, downloaded and installed it, updated my environment variables.
So far the only thing different from guides online is that the folder where sbt is installed…

s3j80
- 143
- 1
- 1
- 9
-1
votes
3 answers
Unable to use object type as method argument in scala shell
The following code doesn't' work in scala shell, but it works in IDE, does anyone how can I use object type as method parameter in scala-shell, thanks.
scala> object A {
| }
defined object A
scala> def f(a:A) :Unit = {
| }
:63:…

zjffdu
- 25,496
- 45
- 109
- 159
-1
votes
1 answer
Using vim editor to create a Scala script within REPL
Version of Scala I am using is Scala 2.12.2 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_121) and the Jline Library present is 2.14.3 .
This could sound silly but I am trying to figure out the problem when trying to create a scala file using…

Ashwin Dora
- 115
- 1
- 12
-2
votes
1 answer
I am trying javap -p classname on scala class but getting error in REPL
scala> class Department( val departmentId: Int, val departmentName: String)
defined class Department
scala> javap -p Department
:12: error: not found: value javap
javap -p Department
^
:12: error: not found: value p
…

Mayank Kishore
- 1
- 1
-2
votes
2 answers
scala repl setting and logs
My scala repl is not showing the logs on the screen as some books and forums seem to suggest. I am on scala 2.12.1. My scala repl when I try below syntax
scala> def sum(a:Int, b:Int) = a+ b
sum: (a: Int, b: Int)Int
Should show as below
scala> val…

curiousengineer
- 2,196
- 5
- 40
- 59