Setup the MXNet Package for Java¶
The following instructions are provided for macOS and Ubuntu. Windows is not yet available.
Note: If you use IntelliJ or a similar IDE, you may want to follow the MXNet-Java on IntelliJ tutorial instead of these instructions.
Step 1. Install dependencies:
brew update brew tap caskroom/versions brew cask install java8 brew install maven
Please run the following lines:
sudo apt-get install openjdk-8-java maven
Step 2. Run the demo MXNet-Java project.
Go to the MXNet-Java demo project’s README and follow the directions to test the MXNet-Java package installation.
MXNet-Java can be easily included in your Maven managed project. The Java packages are currently available on Maven. Add the dependency which corresponds to your platform to the
dependencies tag :
<dependency> <groupId>org.apache.mxnet</groupId> <artifactId>mxnet-full_2.11-linux-x86_64-cpu</artifactId> <version>1.4.0</version> </dependency>
<dependency> <groupId>org.apache.mxnet</groupId> <artifactId>mxnet-full_2.11-linux-x86_64-gpu</artifactId> <version>1.4.0</version> </dependency>
<dependency> <groupId>org.apache.mxnet</groupId> <artifactId>mxnet-full_2.11-osx-x86_64-cpu</artifactId> <version>1.4.0</version> </dependency>
The official Java Packages have been released as part of MXNet 1.4 and are available on the MXNet Maven package repository.
Eclipse IDE Support¶
You can convert your existing Maven project to a project that can run in Eclipse by:
This can be done once you have your maven project properly configured.
The previously mentioned setup with Maven is recommended. Otherwise, the following instructions for macOS and Ubuntu are provided for reference only:
If you have already built mxnet from source using
make clean and then follow the appropriate guide below*
|OS||Step 1||Step 2|
|macOS||Shared Library for macOS||Scala Package for macOS|
|Ubuntu||Shared Library for Ubuntu||Scala Package for Ubuntu|
|Windows||Call for Contribution|
Build Java from an Existing MXNet Installation¶
If you have already built MXNet from source and are looking to setup Java from that point, you may simply run the following from the MXNet
This will install both the Java Inference API and the required MXNet-Scala package.
To build the docs yourself, follow the developer build docs instructions.