Ask Your Question
0

unable to compile java opencv file [closed]

asked 2016-11-09 11:12:35 -0500

aliyesami gravatar image

updated 2016-11-09 11:19:29 -0500

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;

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by aliyesami
close date 2016-11-19 19:05:15.729467

Comments

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

aliyesami gravatar imagealiyesami ( 2016-11-09 12:31:20 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2016-11-12 00:59:48 -0500

aliyesami gravatar image

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
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2016-11-09 11:12:35 -0500

Seen: 1,265 times

Last updated: Nov 12 '16