How to add a jar in zeppelin?

The recommended way is using Zeppelin's Dependency Management

It can add jar file or maven artifact.

the dependency jar will be downloaded to local-repo.

NOTE: If the jar file is compiled from source, when you compile again, it will NOT be synchronised automatically(download again). You need go to interpreter setting, click edit and OK will trigger another download to local-repo.


NOTE: If you use one scala version first, and compiled again with another version. It will report Exception in thread “main” java.lang.NoSuchMethodError: scala.reflect.api.JavaUniverse.runtimeMirror. remove already downloaded jar with rm -rf local-repo/*


NOTE: z.dep is deprecated.


Updated on Zeppelin 0.8.x

You can now load external dependencies or jars using %dep or %spark.dep (if using Spark). Documentation is on zeppline website: Dynamic Dependency Loading

%dep z.load("/path/to/your/packages.jar")

or

%spark.dep
z.reset() // clean up previously added artifact and repository

// add maven repository
z.addRepo("RepoName").url("RepoURL")

// add maven snapshot repository
z.addRepo("RepoName").url("RepoURL").snapshot()

// add credentials for private maven repository
z.addRepo("RepoName").url("RepoURL").username("username").password("password")