You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by la...@apache.org on 2019/02/19 20:36:24 UTC

[incubator-mxnet] branch master updated: Add tutorial on how to use build from source jar (#14197)

This is an automated email from the ASF dual-hosted git repository.

lanking pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git


The following commit(s) were added to refs/heads/master by this push:
     new 49c311c  Add tutorial on how to use build from source jar (#14197)
49c311c is described below

commit 49c311cb2377093bcc13abdb3845401b789892ee
Author: Jake Lee <gs...@gmail.com>
AuthorDate: Wed Feb 20 04:35:51 2019 +0800

    Add tutorial on how to use build from source jar (#14197)
    
    * add tutorial
    
    * fix the typo
---
 scala-package/README.md | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/scala-package/README.md b/scala-package/README.md
index 8322ab2..c7d0cec 100644
--- a/scala-package/README.md
+++ b/scala-package/README.md
@@ -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/)