0

I tried to run DependencyParserDemo.java in Stanford NLP parser.

I use Win7, jdk-10.0.1.

In command line:

Javac -cp stanford-parser.jar DependencyParserDemo.java

Works fine, DependencyParserDemo.class generated.

But when I run:

Java -cp stanford-parser.jar DependencyParserDemo

It shows:

Error: Could not find or load mian class DependencyParserDemo
Caused by: java.lang.ClassNotFoundException: DependencyParserDemo

Maybe the classpath setting is wrong?

3
  • is DependencyParserDemo declared in any package? Commented Jun 18, 2018 at 15:56
  • Nope, not in any package Commented Jun 18, 2018 at 16:00
  • use java -cp .;stanford-parser.jar DependencyParserDemo . You need to include the current working directory in the classpath Commented Jun 18, 2018 at 16:26

1 Answer 1

3

You also need the location of the new class in your classpath.

Java -cp stanford-parser.jar;. DependencyParserDemo
Sign up to request clarification or add additional context in comments.

2 Comments

Now it gives me: Exception in thread "main" edu.stanford.nlp.io.RuntimeIOException: Error while loading a tragger model(probably missing model file)
Now your code starts. And it has a bug. Time to start understanding what you did.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.