Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Add tutorial on how to use build from source jar #14197

Merged
merged 2 commits into from
Feb 19, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions scala-package/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,37 @@ mvn deploy -Pstaging

Examples & Usage
-------
Assuming you use `mvn install`, you can find the `mxnet-full_scala_version-INTERNAL.jar` e.g. `mxnet-full_2.11-INTERNAL.jar` under the path `incubator-mxnet/scala-package/assembly/target`.

Adding the following configuration in `pom.xml`
```HTML
<dependency>
<groupId>org.apache.mxnet</groupId>
<artifactId>mxnet-full_2.11-INTERNAL</artifactId>
<version>1.5.0</version>
<scope>system</scope>
<systemPath>path_to_jar/mxnet-full_2.11-INTERNAL.jar</systemPath>
</dependency>
```
If you have following error message
```
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/mxnet/NDArray
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
at java.lang.Class.getMethod0(Class.java:3018)
at java.lang.Class.getMethod(Class.java:1784)
at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)
Caused by: java.lang.ClassNotFoundException: org.apache.mxnet.NDArray
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
```
Please make sure your $CLASSPATH is able to find `mxnet-full_scala_version-INTERNAL.jar`.

- To set up the Scala Project using IntelliJ IDE on macOS follow the instructions [here](https://mxnet.incubator.apache.org/tutorials/scala/mxnet_scala_on_intellij.html).
- Several examples on using the Scala APIs are provided in the [Scala Examples Folder](https://github.com/apache/incubator-mxnet/tree/master/scala-package/examples/)

Expand Down