Ensure you have installed Anaconda/Miniconda. Instructions can be found here.
Install from the conda-forge software channel:
conda install -c conda-forge jpype1
From source - Requirements¶
Either the Sun/Oracle JDK/JRE Variant or OpenJDK. Python 2.6+ (including Python 3+).
Debian/Ubuntu users will have to install
sudo apt-get install g++ python-dev python3-dev ant
Windows users need a Python installation and C++ compilers:
- Install some version of Python (2.7 or higher), e.g., Anaconda is a good choice for users not yet familiar with the language
- For Python 2 series, Install Windows C++ Compiler
- For Python 3 series, Install Microsoft Visual Studio 2010 Redistributable Package (x64) and Microsoft Build Tools 2015 Update 3
- Install Apache Ant (tested using 1.9.13)
Netbeans ant can be used in place of Apache Ant. Netbeans ant is located in
The Build Tools 2015 is a pain to find. Microsoft really wants people to download the latest version. To get to it from the above URL, click on “Redistributables and Build Tools”, then select Microsoft Build Tools 2015 Update 3.
When building for windows you must use the Visual Studio developer command prompt.
Should be easy as
python setup.py install
For builds with a specific ant, use
python setup.py --ant=C:\My\Ant\Path\ant.bat install
If it fails…¶
This happens mostly due to the setup not being able to find your
JAVA_HOME. In case this happens, please do two things:
You can continue the installation by finding the
JAVA_HOMEon your own ( the place where the headers etc. are) and explicitly setting it for the installation:
JAVA\_HOME=/usr/lib/java/jdk1.6.0/ python setup.py install
Please create an Issue on github and post all the information you have.
- OS X 10.7.4 with Sun/Oracle JDK 1.6.0
- OSX 10.8.1-10.8.4 with Sun/Oracle JDK 1.6.0
- OSX 10.9 DP5
- Debian 6.0.4/6.0.5 with Sun/Oracle JDK 1.6.0
- Debian 7.1 with OpenJDK 1.6.0
- Ubuntu 12.04 with Sun/Oracle JDK 1.6.0
- Java classes outside of a package (in the
<default>) cannot be imported.
- unable to access a field or method if it conflicts with a python keyword.
- Because of lack of JVM support, you cannot shutdown the JVM and then restart it.
- Some methods rely on the “current” class/caller. Since calls coming directly from python code do not have a current class, these methods do not work. The User Manual lists all the known methods like that.
- Mixing 64 bit Python with 32 bit Java and vice versa crashes on import jpype.