amibar
amibar

Reputation: 31

Dealing with the test.java in CRF++ toolkit

After installing CRF++ toolkit, I try to run the program "test.java" under CRF++-0.54/java folder. For this, I type :

java -cp /home/amira/CRF++-0.54/java/org/chasen/crfpp test 

But, I have the following error:

Exception in thread "main" java.lang.NoClassDefFoundError: test
Caused by: java.lang.ClassNotFoundException: test
    at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
Could not find the main class: test. Program will exit.

In the README file, there is the command java -classpath CRFPP.jar test -d ../dic. But, the problem is that I don't find the classpath of CRFPP.jar. Moreover, I don't understand what ../dic in the command refer to.

Upvotes: 0

Views: 1352

Answers (1)

nlpuser
nlpuser

Reputation: 51

  1. Make changes in the Makefile of the java directory as per your machine settings.
  2. Give the correct Java path and the compiler you are using using.
  3. Run make java in the swig directory.
  4. Run make all in the java directory.
  5. Before running make in the java directory, ensure that you have the model file in the proper location, otherwise it won't open the model file.
  6. Run make test in the java directory.

Upvotes: 5

Related Questions