I'm currently trying to install Apache Arrow for Java in Eclipse and having some troubles.
I've found the Java Packages on https://search.maven.org/search?q=g:org.apache.arrow%20AND%20v:0.17.1
Because I didn't find any information about the installation, I just downloaded all the jar files:
- arrow-peformance-0.17.1.jar
- arrow-algorithm-0.17.1.jar
- arrow-avro-0.17.1.jar
- flight-grpc-0.17.1.jar
- flight-core-0.17.1.jar
- arrow-plasma-0.17.1.jar
- arrow-jdbc-0.17.1.jar
- arrow-tools-0.17.1.jar
- arrow-vector-0.17.1.jar
- arrow-memory-0.17.1.jar
- arrow-format-0.17.1.jar
I then created a new Java project in Eclipse and copied all the jar files into a folder 'lib' in said project. Then, I added them under Project -> Properties -> Java Build Path -> Libraries -> Add JARs
and selected all the jars in my 'lib' folder and applied.
After that, I tried to run the following java-code which I found on https://github.com/animeshtrivedi/blog/blob/master/post/2017-12-26-arrow.md:
import org.apache.arrow.vector.types.pojo.*;
public class FieldTesting {
public static void main(String[] args) {
Field intField = new Field("int", FieldType.nullable(new ArrowType.Int(32, true)), null);
}
}
I get the following error message:
Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
at org.apache.arrow.vector.types.pojo.Field.<clinit>(Field.java:55)
at FieldTesting.main(FieldTesting.java:6)
Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 2 more
When I go to Referenced Libraries -> arrow-vector-0.17.1.jar -> org.apache.arrow.vector.types.pojo -> Field.class
, it says "Source not found" as seen below. Do I need to attach the source manually?
On the Apache Arrow website, where I downloaded the jar files, there were also "...sources.jar" files which I could download. Do I need to also download those and add them to the "Java Build Path"? (That seems like a lot of work).
There was also a "arrow-java-root" zip folder, can I somehow use this to add the library?
I'm not familiar with adding libraries to Java, so I don't know how to fix this. Any help is appreciated.
(I am on Windows 10, java 8)
Solution:
I converted my Project to a Maven Project (Configure -> Convert to Maven Project
) and added the dependency "arrow-java-root"
. (https://stackoverflow.com/a/26350902) Thanks to andrewjames for pointing this out.
However, I now get the following message when I run the program:
ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.
But the program still terminates correctly, because if I add:
System.out.println(intField.toString())
It prints the field after the message above.