How to use an external java library? (ND4J)

I would like to use the n-dimentional array feature from the ND4J java library. https://nd4j.org/getstarted Is it possible to use it with Processing? If so, what would be the steps?

Tagged:

Answers

  • I'm sure this is covered on the processing web page.

    But generally, copy the jar to the library folder following the usual naming convention. Then you can just import the classes normally.

    https://github.com/processing/processing/wiki/How-to-Install-a-Contributed-Library

  • put lib in to "code" folder and enjoy it..

  • Thank you, but there is a slight problem... So when I go to git with the library, it only has .java files and no .jar files. The nd4g people recommend using Maven, but I am not entirely sure how and what that it, at least I found no clue of how to use it with Processing.

    I've searched for some .jar files of this library and I was able to download them here - https://jar-download.com/?search_box=nd4j

    After downloading and putting them into the "code" folder my Processing sketch was able to communicate with them, but then it turned out that some more dependencies were missing. Apparently, I can't really add the library manually and it is only possible to do it using Maven or other tools. There are just way too many dependencies.

    I bet that I am just doing something wrong... I really need your help, thanks.

  • Answer ✓

    Well, if the library uses other libraries then you'll need those too. Recursively. Which is what maven would do for you in a normal Java project.

    You could do it manually.

  • edited March 2018 Answer ✓

    Maybe you can get a complete ND4J ".jar" file from this link: :-/ http://Search.Maven.org/#search|ga|1|a:"nd4j-uberjar"

    If that's indeed the file, you can drag & drop it inside the PDE, so it automatically creates a "code/" subfolder for the ".jar" file. *-:)

  • GoToLoop, thanks for the link, but it was not really the full .jar file, it's also too small for that.

    Apart from that, I guess I will have to find another way of implementing the function I need. It is probably possible to do it through trying it with a different environment, for example using processing libs in eclipse, but I will save this tedious task for next time, as this is not the main objective of my project.

Sign In or Register to comment.