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

Adding a Jar #28

Closed
babak12 opened this issue Oct 2, 2015 · 6 comments
Closed

Adding a Jar #28

babak12 opened this issue Oct 2, 2015 · 6 comments

Comments

@babak12
Copy link

babak12 commented Oct 2, 2015

Is there any way to load jar in Jupyter-scala? I used :cp /something.jar to load local jar files into Scala REPL. How can I do it with jupiyer-scala? Thanks

@praveen-srinivasan
Copy link

load.jar("/home/foo/bar.jar")

@alexarchambault
Copy link
Member

@praveen-srinivasan Thanks for answering that !

@babak12
Copy link
Author

babak12 commented Oct 6, 2015

Thank you guys!

@Mageswaran1989
Copy link

I couldn't understand above solution. I have a sbt assembled "jar" file. How to include that in jupyter-scala ?

@animeshsrivastava24
Copy link

animeshsrivastava24 commented Jul 10, 2018

If you want to add a local jar to Jupyter Scala , follow the instructions :
Create a jar file for your project work

Find the path to the jar

Go to Jupyter Scala cell and type all the instructions in a single cell or split them in different cells as per your convenience

import ammonite., ammonite.ops.

val path = java.nio.file.FileSystems.getDefault().getPath("/home/animesh/Bureau/lastest_n2s3/out/artifacts/root_jar/root.jar") // here inside the " " add your path, I have added mine for example

val x = ammonite.ops.Path(path)

interp.load.cp(x)

It works for me, please check for yourself.
@babak12 @Mageswaran1989

@alexarchambault
Copy link
Member

Closing this now that the upcoming version is about to become the default one. It mostly wraps Ammonite now. Ask for help there if it's still a problem for you.

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

5 participants