diff --git a/scala-package/README.md b/scala-package/README.md index 8322ab2a237f..c7d0cecf15ac 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 + + org.apache.mxnet + mxnet-full_2.11-INTERNAL + 1.5.0 + system + path_to_jar/mxnet-full_2.11-INTERNAL.jar + +``` +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/)