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

Pass CLASSPATH variable through to scala interpreter #33

Closed
tonycpsu opened this issue Oct 28, 2015 · 4 comments
Closed

Pass CLASSPATH variable through to scala interpreter #33

tonycpsu opened this issue Oct 28, 2015 · 4 comments

Comments

@tonycpsu
Copy link

The scala REPL can pull in JAR files from the CLASSPATH like so:

$ CLASSPATH=/foo/bar/baz.jar scala

However, trying the same with jupyter-console doesn't seem to work:

$  CLASSPATH=/foo/bar/baz.jar jupyter-console --kernel=scala211

I know about load.jar("/foo/bar/baz.jar"), but it's much easier to use the environment variable than to have to load each jar individually.

@alexarchambault
Copy link
Member

It can't be done as is, the kernel somehow filters the classpath it is started with, in order not to expose all of its own dependencies. Having some kind of predef, like Ammonite does, would allow to solve the problem by putting load.jar lines in it.

@maclockard
Copy link

Is it possible to just use the Ammonite predef, or will there need to be a separate predef created to work with the kernel?

@espears4sq
Copy link

espears4sq commented Aug 27, 2018

I have the same question as @maclockard . How do we define predef scripts that will be picked up when running both of jupyter notebook (and selecting the scala kernel), and jupyter console --kernel scala?

I tried modifying the ammonite predef in ~/.ammonite, but neither method of launching jupyter-scala will load or execute any files from that path at all. Is there a different location for the jupyter-based equivalent predef?

@alexarchambault
Copy link
Member

Closing this now that the upcoming version is about to become the default one. It accepts a --predef option to run some code upfront.

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

No branches or pull requests

4 participants