unable to compile java opencv file [closed]
I have copied the opencv-xxx.jar file to the local lib directory but I am getting errors shown below:
[root@hadoop1 lib]# pwd
/root/Vision/opencv/samples/java/sbt/lib copy_opencv_jar_here opencv-248.jar
/root/Vision/opencv/samples/java/sbt/src/main/java NOTE>: I am trying to attach this file but the site is not letting me . This is the standard sample program that comes with the openCV installation.
DetectFaceDemo.java target
[root@hadoop1 java]# sbt compile
[info] Set current project to java (in build file:/root/Vision/opencv/samples/java/sbt/src/main/java/) [info] Updating {file:/root/Vision/opencv/samples/java/sbt/src/main/java/}java... [info] Resolving org.fusesource.jansi#jansi;1.4 ... [info] Done updating. [info] Compiling 1 Java source to /root/Vision/opencv/samples/java/sbt/src/main/java/target/scala-2.10/classes... [error] /root/Vision/opencv/samples/java/sbt/src/main/java/DetectFaceDemo.java:1: error: package org.opencv.core does not exist [error] import org.opencv.core.Core; [error] ^ [error] /root/Vision/opencv/samples/java/sbt/src/main/java/DetectFaceDemo.java:2: error: package org.opencv.core does not exist [error] import org.opencv.core.Mat; [error] ^ [error] /root/Vision/opencv/samples/java/sbt/src/main/java/DetectFaceDemo.java:3: error: package org.opencv.core does not exist [error] import org.opencv.core.MatOfRect;
the issue is fixed by using the build file (I found on web) and copying the opencv-248.jar in the ./lib folder
build.sbt DetectFaceDemo.java lib project target [root@hadoop1 java]# more build.sbt name := "opencv_usage_scala"
scalaVersion := "2.11.6"
scalacOptions ++= Seq( "-unchecked", "-deprecation", "-optimize", "-Xlint" )
javaOptions in run += "-Djava.library.path=./lib"
lazy val root = (project in file("."))
fork := true