-1

I get the following error when I try to run

java -cp 'angus-sdk-java-0.0.2-jar-with-dependencies.jar:.' FaceDetect

I am following a tutorial for face detection in http://angus-doc.readthedocs.io/en/latest/getting-started/java.html . Below is my java code,

import java.io.IOException;
import org.json.simple.JSONObject;
import ai.angus.sdk.Configuration;
import ai.angus.sdk.Job;
import ai.angus.sdk.ProcessException;
import ai.angus.sdk.Root;
import ai.angus.sdk.Service;
import ai.angus.sdk.impl.ConfigurationImpl;
import ai.angus.sdk.impl.File;

public class FaceDetect {

  public static void main(String[] args) throws IOException, ProcessException {
    Configuration conf = new ConfigurationImpl();

    Root root = conf.connect();
    Service service = root.getServices().getService("age_and_gender_estimation", 1);

    JSONObject params = new JSONObject();
    params.put("image", new File("Downloads/IMG_1060.jpg"));

    Job job = service.process(params);

    System.out.println(job.getResult().toJSONString());
 }
}

I don't understand the problem with it. I have tried all the answers in the stack overflow but nothing is working for me.

shamila
  • 1,280
  • 6
  • 20
  • 45

1 Answers1

0

remove the single qoutes around the classpath:

java -cp angus-sdk-java-0.0.2-jar-with-dependencies.jar:. FaceDetect

Jens
  • 67,715
  • 15
  • 98
  • 113
  • @ShamilaSallay What is your actual working directory? It must be the folder where the FaceDetect.class is located – Jens Jul 16 '16 at 06:52
  • The located place is correct and I'm running this command inside that deirectory – shamila Jul 16 '16 at 06:56