lidavidm commented on a change in pull request #12534:
URL: https://github.com/apache/arrow/pull/12534#discussion_r820786347



##########
File path: docs/source/developers/java/building.rst
##########
@@ -0,0 +1,239 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+.. highlight:: console
+
+.. _building-arrow-java:
+
+===================
+Building Arrow Java
+===================
+
+.. contents::
+
+System Setup
+============
+
+Arrow Java uses the `Maven <https://maven.apache.org/>`_ build system.
+
+Building requires:
+
+* JDK 8, 9, 10, or 11, but only JDK 11 is tested in CI
+* Maven 3+
+
+Building
+========
+
+All the instructions below assume that you have cloned the Arrow git
+repository:
+
+.. code-block::
+
+    $ git clone https://github.com/apache/arrow.git
+    $ cd arrow
+    $ git submodule update --init --recursive
+
+Basic Installation
+------------------
+
+To build the default modules, go to the project root and execute:
+
+.. code-block::
+
+    $ cd arrow/java
+    $ export JAVA_HOME=<absolute path to your java home>
+    $ java --version
+    $ mvn clean install
+
+Building JNI Libraries on Linux
+-------------------------------
+
+First, we need to build the `C++ shared libraries`_ that the JNI bindings will 
use.
+We can build these manually or we can use `Archery`_ to build them using a 
Docker container
+(This will require installing Docker, Docker Compose, and Archery).
+
+.. code-block::
+
+    $ cd arrow
+    $ archery docker run java-jni-manylinux-2014
+    $ ls -latr java-dist/
+    |__ libarrow_cdata_jni.so
+    |__ libarrow_dataset_jni.so
+    |__ libarrow_orc_jni.so
+    |__ libgandiva_jni.so
+
+Building JNI Libraries on MacOS
+-------------------------------
+
+To build only the C Data Interface library:
+
+.. code-block::
+
+    $ cd arrow
+    $ brew bundle --file=cpp/Brewfile
+    Homebrew Bundle complete! 25 Brewfile dependencies now installed.
+    $ export JAVA_HOME=<absolute path to your java home>
+    $ mkdir -p java-dist java-native-c
+    $ cd java-native-c
+    $ cmake \
+        -DCMAKE_BUILD_TYPE=Release \
+        -DCMAKE_INSTALL_LIBDIR=lib \
+        -DCMAKE_INSTALL_PREFIX=../java-dist \
+        ../java/c
+    $ cmake --build . --target install
+    $ ls -latr ../java-dist/lib
+    |__ libarrow_cdata_jni.dylib
+
+To build other JNI libraries:
+
+.. code-block::
+
+    $ cd arrow
+    $ brew bundle --file=cpp/Brewfile
+    Homebrew Bundle complete! 25 Brewfile dependencies now installed.
+    $ export JAVA_HOME=<absolute path to your java home>
+    $ mkdir -p java-dist java-native-cpp
+    $ cd java-native-cpp
+    $ cmake \
+        -DARROW_BOOST_USE_SHARED=OFF \
+        -DARROW_BROTLI_USE_SHARED=OFF \
+        -DARROW_BZ2_USE_SHARED=OFF \
+        -DARROW_GFLAGS_USE_SHARED=OFF \
+        -DARROW_GRPC_USE_SHARED=OFF \
+        -DARROW_LZ4_USE_SHARED=OFF \
+        -DARROW_OPENSSL_USE_SHARED=OFF \
+        -DARROW_PROTOBUF_USE_SHARED=OFF \
+        -DARROW_SNAPPY_USE_SHARED=OFF \
+        -DARROW_THRIFT_USE_SHARED=OFF \
+        -DARROW_UTF8PROC_USE_SHARED=OFF \
+        -DARROW_ZSTD_USE_SHARED=OFF \
+        -DARROW_JNI=ON \
+        -DARROW_PARQUET=ON \
+        -DARROW_FILESYSTEM=ON \
+        -DARROW_DATASET=ON \
+        -DARROW_GANDIVA_JAVA=ON \
+        -DARROW_GANDIVA_STATIC_LIBSTDCPP=ON \
+        -DARROW_GANDIVA=ON \
+        -DARROW_ORC=ON \
+        -DARROW_PLASMA_JAVA_CLIENT=ON \
+        -DARROW_PLASMA=ON \
+        -DCMAKE_BUILD_TYPE=Release \
+        -DCMAKE_INSTALL_LIBDIR=lib \
+        -DCMAKE_INSTALL_PREFIX=../java-dist \
+        -DCMAKE_UNITY_BUILD=ON \
+        -Dre2_SOURCE=BUNDLED \
+        -DBoost_SOURCE=BUNDLED \
+        -Dutf8proc_SOURCE=BUNDLED \
+        -DSnappy_SOURCE=BUNDLED \
+        -DORC_SOURCE=BUNDLED \
+        -DZLIB_SOURCE=BUNDLED \
+        ../cpp
+    $ cmake --build . --target install
+    $ ls -latr  ../java-dist/lib
+    |__ libarrow_dataset_jni.dylib
+    |__ libarrow_orc_jni.dylib
+    |__ libgandiva_jni.dylib
+
+Building Arrow JNI Modules
+--------------------------
+
+To compile the JNI bindings, use the ``arrow-c-data`` Maven profile:
+
+.. code-block::
+
+    $ cd arrow/java
+    $ mvn -Darrow.c.jni.dist.dir=../java-dist/lib -Parrow-c-data clean install
+
+To compile the JNI bindings for ORC / Gandiva / Dataset, use the ``arrow-jni`` 
Maven profile:
+
+.. code-block::
+
+    $ cd arrow/java
+    $ mvn -Darrow.cpp.build.dir=../java-dist/lib -Parrow-jni clean install
+
+IDE Configuration
+=================
+
+IntelliJ IDE
+------------
+
+Go to open java project and select java folder.
+
+When IntelliJ open arrow java project its compiled automatically and show you 
maven modules inside root project and
+also offer a side bar to see profile and maven plugin configured by default.
+
+.. figure:: img/java_welcome.png
+   :scale: 50 %
+   :alt: A newly opened Arrow project
+
+Also IntelliJ offer options to configure custom run/debug configurations to 
setup maven module working directory,
+maven command line to run, profiles, configure JRE to use, add environment 
variables as some examples of these.
+Option available at: Run -> Edit Configurations.

Review comment:
       We shouldn't need to explain how to use IntelliJ.

##########
File path: docs/source/developers/java/building.rst
##########
@@ -0,0 +1,239 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+.. or more contributor license agreements.  See the NOTICE file
+.. distributed with this work for additional information
+.. regarding copyright ownership.  The ASF licenses this file
+.. to you under the Apache License, Version 2.0 (the
+.. "License"); you may not use this file except in compliance
+.. with the License.  You may obtain a copy of the License at
+
+..   http://www.apache.org/licenses/LICENSE-2.0
+
+.. Unless required by applicable law or agreed to in writing,
+.. software distributed under the License is distributed on an
+.. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+.. KIND, either express or implied.  See the License for the
+.. specific language governing permissions and limitations
+.. under the License.
+
+.. highlight:: console
+
+.. _building-arrow-java:
+
+===================
+Building Arrow Java
+===================
+
+.. contents::
+
+System Setup
+============
+
+Arrow Java uses the `Maven <https://maven.apache.org/>`_ build system.
+
+Building requires:
+
+* JDK 8, 9, 10, or 11, but only JDK 11 is tested in CI
+* Maven 3+
+
+Building
+========
+
+All the instructions below assume that you have cloned the Arrow git
+repository:
+
+.. code-block::
+
+    $ git clone https://github.com/apache/arrow.git
+    $ cd arrow
+    $ git submodule update --init --recursive
+
+Basic Installation
+------------------
+
+To build the default modules, go to the project root and execute:
+
+.. code-block::
+
+    $ cd arrow/java
+    $ export JAVA_HOME=<absolute path to your java home>
+    $ java --version
+    $ mvn clean install
+
+Building JNI Libraries on Linux
+-------------------------------
+
+First, we need to build the `C++ shared libraries`_ that the JNI bindings will 
use.
+We can build these manually or we can use `Archery`_ to build them using a 
Docker container
+(This will require installing Docker, Docker Compose, and Archery).
+
+.. code-block::
+
+    $ cd arrow
+    $ archery docker run java-jni-manylinux-2014
+    $ ls -latr java-dist/
+    |__ libarrow_cdata_jni.so
+    |__ libarrow_dataset_jni.so
+    |__ libarrow_orc_jni.so
+    |__ libgandiva_jni.so
+
+Building JNI Libraries on MacOS
+-------------------------------
+
+To build only the C Data Interface library:
+
+.. code-block::
+
+    $ cd arrow
+    $ brew bundle --file=cpp/Brewfile
+    Homebrew Bundle complete! 25 Brewfile dependencies now installed.
+    $ export JAVA_HOME=<absolute path to your java home>
+    $ mkdir -p java-dist java-native-c
+    $ cd java-native-c
+    $ cmake \
+        -DCMAKE_BUILD_TYPE=Release \
+        -DCMAKE_INSTALL_LIBDIR=lib \
+        -DCMAKE_INSTALL_PREFIX=../java-dist \
+        ../java/c
+    $ cmake --build . --target install
+    $ ls -latr ../java-dist/lib
+    |__ libarrow_cdata_jni.dylib
+
+To build other JNI libraries:
+
+.. code-block::
+
+    $ cd arrow
+    $ brew bundle --file=cpp/Brewfile
+    Homebrew Bundle complete! 25 Brewfile dependencies now installed.
+    $ export JAVA_HOME=<absolute path to your java home>
+    $ mkdir -p java-dist java-native-cpp
+    $ cd java-native-cpp
+    $ cmake \
+        -DARROW_BOOST_USE_SHARED=OFF \
+        -DARROW_BROTLI_USE_SHARED=OFF \
+        -DARROW_BZ2_USE_SHARED=OFF \
+        -DARROW_GFLAGS_USE_SHARED=OFF \
+        -DARROW_GRPC_USE_SHARED=OFF \
+        -DARROW_LZ4_USE_SHARED=OFF \
+        -DARROW_OPENSSL_USE_SHARED=OFF \
+        -DARROW_PROTOBUF_USE_SHARED=OFF \
+        -DARROW_SNAPPY_USE_SHARED=OFF \
+        -DARROW_THRIFT_USE_SHARED=OFF \
+        -DARROW_UTF8PROC_USE_SHARED=OFF \
+        -DARROW_ZSTD_USE_SHARED=OFF \
+        -DARROW_JNI=ON \
+        -DARROW_PARQUET=ON \
+        -DARROW_FILESYSTEM=ON \
+        -DARROW_DATASET=ON \
+        -DARROW_GANDIVA_JAVA=ON \
+        -DARROW_GANDIVA_STATIC_LIBSTDCPP=ON \
+        -DARROW_GANDIVA=ON \
+        -DARROW_ORC=ON \
+        -DARROW_PLASMA_JAVA_CLIENT=ON \
+        -DARROW_PLASMA=ON \
+        -DCMAKE_BUILD_TYPE=Release \
+        -DCMAKE_INSTALL_LIBDIR=lib \
+        -DCMAKE_INSTALL_PREFIX=../java-dist \
+        -DCMAKE_UNITY_BUILD=ON \
+        -Dre2_SOURCE=BUNDLED \
+        -DBoost_SOURCE=BUNDLED \
+        -Dutf8proc_SOURCE=BUNDLED \
+        -DSnappy_SOURCE=BUNDLED \
+        -DORC_SOURCE=BUNDLED \
+        -DZLIB_SOURCE=BUNDLED \
+        ../cpp
+    $ cmake --build . --target install
+    $ ls -latr  ../java-dist/lib
+    |__ libarrow_dataset_jni.dylib
+    |__ libarrow_orc_jni.dylib
+    |__ libgandiva_jni.dylib
+
+Building Arrow JNI Modules
+--------------------------
+
+To compile the JNI bindings, use the ``arrow-c-data`` Maven profile:
+
+.. code-block::
+
+    $ cd arrow/java
+    $ mvn -Darrow.c.jni.dist.dir=../java-dist/lib -Parrow-c-data clean install
+
+To compile the JNI bindings for ORC / Gandiva / Dataset, use the ``arrow-jni`` 
Maven profile:
+
+.. code-block::
+
+    $ cd arrow/java
+    $ mvn -Darrow.cpp.build.dir=../java-dist/lib -Parrow-jni clean install
+
+IDE Configuration
+=================
+
+IntelliJ IDE
+------------
+
+Go to open java project and select java folder.
+
+When IntelliJ open arrow java project its compiled automatically and show you 
maven modules inside root project and
+also offer a side bar to see profile and maven plugin configured by default.
+
+.. figure:: img/java_welcome.png
+   :scale: 50 %
+   :alt: A newly opened Arrow project
+
+Also IntelliJ offer options to configure custom run/debug configurations to 
setup maven module working directory,
+maven command line to run, profiles, configure JRE to use, add environment 
variables as some examples of these.
+Option available at: Run -> Edit Configurations.
+
+Let's create our maven configuration: java-dataset
+
+.. figure:: img/java_mvn_configuration.png
+   :scale: 50 %
+   :alt: Setup new maven configurations with working directory, command to run 
and profile used to build

Review comment:
       Again: we need to say what settings we want people to change! For 
instance: "Set the profile to 'arrow-jni' and ...". 
   
   If these are obvious or if there's nothing to change, then remove the 
screenshot, it's just clutter otherwise. 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to