title: Using weka from a batch file
body: <p>I want to make predictions from a Weka saved model without opening Weka Explorer or Simple CLI interfaces. So I created a batch file:</p>
  
  <pre><code>@ECHO ON
  
  title Weka caller
  
  set root=C:\Program Files\Weka-3-8\
  
  cd /D %root%
  
  java -classpath weka.jar weka.classifiers.functions.LinearRegression -T Z:\ARFF_FILES\TestSet_regression.arff -l Z:\WEKA_MODELS\Regression_model_03_05_2018.model -p 0
  </code></pre>
  
  <p>I have this error message: </p>
  
  <pre><code>C:\Program Files\Weka-3-8&gt;java -classpath weka.jar weka.classifiers.functions.LinearRegression -T Z:\ARFF_FILES\TestSet_regression.arff -l Z:\WEKA_MODELS\Regression_model_03_05_2018.model -p 0
  Error: A JNI error has occurred, please check your installation and try again
  Exception in thread "main" java.lang.NoClassDefFoundError: no/uib/cipr/matrix/Matrix
      at java.lang.Class.getDeclaredMethods0(Native Method)
      at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
      at java.lang.Class.privateGetMethodRecursive(Unknown Source)
      at java.lang.Class.getMethod0(Unknown Source)
      at java.lang.Class.getMethod(Unknown Source)
      at sun.launcher.LauncherHelper.validateMainClass(Unknown Source)
      at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
  Caused by: java.lang.ClassNotFoundException: no.uib.cipr.matrix.Matrix
      at java.net.URLClassLoader.findClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      ... 7 more
  </code></pre>
  
  <p>Is someone already called weka from windows cmd shell ??</p>