Skip to content

How do I run scala code blocks in org-mode? #148

@ag91

Description

@ag91

Thanks for the great software guys.
I am a heavy user of org mode and I would like to evaluate scala blocks.
Is there an explanation somewhere on how to do it?

I would like to be able to C-c C-c on a block such this:

#+BEGIN_SRC scala :results output
println("hi")
#+END_SRC

And get something like:

#+RESULT:
hi

However if I try, I get Not connected. M-x ensime to connect.
Now I understand I need an Ensime session running, but after setting up one for a sample project (build.sbt and running sbt ensimeConfig), it still does not work.

Am I missing something? Is there any tutorial/docs on how to do this?

Ideally I would like to run the previous source block just with the Scala binary,
and I would like to have the option to run the great Ensime with something like:

#+BEGIN_SRC scala :ensime-project /someDir :session someSession
import superCoolDependency;

println(superCoolDependency.superCoolPrintout())
#+END_SRC

And using the session to refer to the Ensime connection in future blocks.

Thanks again!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions