Skip to content
This repository has been archived by the owner on Feb 9, 2021. It is now read-only.

Commit

Permalink
Add tutorial on how to use build from source jar (apache#14197)
Browse files Browse the repository at this point in the history
* add tutorial

* fix the typo
  • Loading branch information
stu1130 authored and Gordon Reid committed Feb 28, 2019
1 parent 8c783ee commit ca1940b
Showing 1 changed file with 31 additions and 0 deletions.
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

0 comments on commit ca1940b

Please sign in to comment.