.. _building:
Building PyJNIus
================
Building PyJNIus is necessary for development purposes, or if there is no
pre-built binary for your particular platform.
Like installation of PyJNIus, building PyJNIus requires a `Java Development Kit
`_ (JDK)
to be installed.
Apart from the JDK, the build requirements for each platform are as follows:
- Linux: the `GNU Compiler Collection `_ (GCC), e.g. using
`apt-get install build-essentials` on Debian-based distributions.
- Windows: `Microsoft Visual C++ Build Tools `_
(the command-line tools subset of Visual Studio).
For more information or options, see Python's `Windows Compilers wiki
`_.
- macOS: `Xcode command-line tools `_.
In all cases, after checking out PyJNIus from GitHub, it can be *built* and installed using::
pip install .
This installs `Cython `_ (as specified in the
`pyproject.toml `_)
in a Python build environment. On all platforms, if PyJNIus cannot find your JDK, you can set
the `JAVA_HOME` environment variable (this is often needed on Windows).
If you want to compile the PyJNIus extension within the directory for any development,
just type::
make
You can run the tests suite to make sure everything is running right::
make tests
In these cases, you may need to have `Cython `_
and `pytest `_ installed in the current Python environment.