# Jars from maven to Ant project / resolving backend

**URL:** <https://community.konduit.ai/t/jars-from-maven-to-ant-project-resolving-backend/1061>\
**Category:** ND4J\
**Created:** [December 15, 2020, 7:14pm UTC](https://community.konduit.ai/t/jars-from-maven-to-ant-project-resolving-backend/1061 "2020-12-15T19:14:02Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![MotoCommando](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/motocommando/32/404_2.png) [@MotoCommando](https://community.konduit.ai/u/MotoCommando)\
**Post date:** [December 15, 2020, 7:14pm UTC](https://community.konduit.ai/t/jars-from-maven-to-ant-project-resolving-backend/1061/1 "2020-12-15T19:14:02Z")

</div>

Hi,  
Currently I’m developing an app which is ant project (and won’t become maven any time soon) and I would like to use deeplearning4j for some ML tasks in the app. I have already build maven project and I started adding manually required jars that I need (datavec,deeplearning4j-nn, etc). With trial and error I’ve got majority of the necessary files however in the end I’ve got backend error:  
19:50:17,625 VNM-conv2[3] ERROR sNowExceptionHandler.uncaughtException 1499: Uncaught exception occurred in thread Thread[VNM-conv2[3],6,main]  
java.lang.ExceptionInInitializerError  
at org.visnow.vn.lib.external.readers.conv2.Conv2.onActive(Conv2.java:187)  
at org.visnow.vn.engine.core.ModuleCore.onLocalActive(ModuleCore.java:589)  
at org.visnow.vn.engine.main.ModuleElement.setActive(ModuleElement.java:329)  
at org.visnow.vn.engine.main.ModuleElement.onActionMessage(ModuleElement.java:283)  
at org.visnow.vn.engine.element.Element.nextMessage(Element.java:215)  
at org.visnow.vn.engine.element.Element.run(Element.java:177)  
at java.lang.Thread.run(Thread.java:748)  
Caused by: java.lang.RuntimeException: org.nd4j.linalg.factory.Nd4jBackend$NoAvailableBackendException: Please ensure that you have an nd4j backend on your classpath. Please see: [https://deeplearning4j.konduit.ai/nd4j/backend](https://deeplearning4j.konduit.ai/nd4j/backend)  
at org.nd4j.linalg.factory.Nd4j.initContext(Nd4j.java:5094)  
at org.nd4j.linalg.factory.Nd4j.(Nd4j.java:270)  
… 7 more  
Caused by: org.nd4j.linalg.factory.Nd4jBackend$NoAvailableBackendException: Please ensure that you have an nd4j backend on your classpath. Please see: [https://deeplearning4j.konduit.ai/nd4j/backend](https://deeplearning4j.konduit.ai/nd4j/backend)  
at org.nd4j.linalg.factory.Nd4jBackend.load(Nd4jBackend.java:221)  
at org.nd4j.linalg.factory.Nd4j.initContext(Nd4j.java:5091)  
… 8 more

I had the following jars added for backend:  
nd4j-native-1.0.0-SNAPSHOT.jar  
nd4j-native-1.0.0-SNAPSHOT-linux-x86\_64.jar  
nd4j-native-platform-1.0.0-SNAPSHOT.jar  
nd4j-native-platform-1.0.0-SNAPSHOT-linux-x86\_64.jar  
nd4j-backend-impls-1.0.0-SNAPSHOT.jar

Someone knows how to resolve this issue?

P.S. I’m also wondering whether I need to get other jars to the project like openblas, opencv or leptonica  
but I guess they are not connected with running nd4j

---

<div class="post-metadata">

**Author:** ![agibsonccc](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/agibsonccc/32/697_2.png) [@agibsonccc](https://community.konduit.ai/u/agibsonccc)\
**Post date:** [December 16, 2020, 12:58am UTC](https://community.konduit.ai/t/jars-from-maven-to-ant-project-resolving-backend/1061/2 "2020-12-16T00:58:45Z")

</div>

@MotoCommando I’m not going to remotely support you even attempting to do this. If you can’t build using maven for whatever reason, please use maven to assemble 1 uber jar using the shade or assembly plugins that you include manually using ant. That’s the only way to make this error prone and reproducible enough to be supportable from our side here.  
I’m not going to attempt to try to list every single transitive dependency we need when automated tools that are well documented can already do this.  
Example here:  
[https://maven.apache.org/plugins/maven-shade-plugin/examples/includes-excludes.html](https://maven.apache.org/plugins/maven-shade-plugin/examples/includes-excludes.html)

Bare minimum template pom.xml here:  
[https://github.com/eclipse/deeplearning4j-examples/blob/master/mvn-project-template/pom.xml](https://github.com/eclipse/deeplearning4j-examples/blob/master/mvn-project-template/pom.xml)

---

<div class="post-metadata">

**Author:** ![MotoCommando](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/motocommando/32/404_2.png) [@MotoCommando](https://community.konduit.ai/u/MotoCommando)\
**Post date:** [December 17, 2020, 12:42pm UTC](https://community.konduit.ai/t/jars-from-maven-to-ant-project-resolving-backend/1061/3 "2020-12-17T12:42:26Z")

</div>

@agibsonccc thank you for your reply and all the help  
I still consider myself a beginner so some things that might seem obvious are new to me. Thank you once more for your help and sorry for trouble!

---

<div class="post-metadata">

**Author:** ![agibsonccc](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/agibsonccc/32/697_2.png) [@agibsonccc](https://community.konduit.ai/u/agibsonccc)\
**Post date:** [December 17, 2020, 12:44pm UTC](https://community.konduit.ai/t/jars-from-maven-to-ant-project-resolving-backend/1061/4 "2020-12-17T12:44:47Z")

</div>

@MotoCommando sure I just want to be clear about what is/isn’t normal workflow wise and I hope to give you something that works well enough for your use case. I know maven isn’t ok in every scenario, but for the basics, but in general it’s just a lot more work than its worth to doing things manually. Dl4j is just too big to do that at this point.

---

<div class="post-metadata">

**Author:** ![MotoCommando](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/motocommando/32/404_2.png) [@MotoCommando](https://community.konduit.ai/u/MotoCommando)\
**Post date:** [December 18, 2020, 10:09am UTC](https://community.konduit.ai/t/jars-from-maven-to-ant-project-resolving-backend/1061/5 "2020-12-18T10:09:09Z")

</div>

Creating uber jar with dependencies resolved this problem  
@agibsonccc thank you for help
