Yes, try to use the "-classpath" argument of javac,
so you need to write something like this:

javac -classpath opennlp-tools-1.5.0.jar Test.java

Jörn

On 12/7/10 9:54 PM, Congmin min wrote:
Thanks. But I added it to my classpath:
C:\myclasses\opennlp-tools-1.5.0.jar, and then run "javac Test.java", it
shows that error: cant find the packages.

Any idea? thanks.


---------- Forwarded message ----------
From: Jörn Kottmann<[email protected]>
Date: Tue, Dec 7, 2010 at 10:31 AM
Subject: Re: Use of Opennlp
To: [email protected]


Hello,
please post questions about the usage on the opennlp-users mailing list.

The opennlp-tools-1.5.0.jar must be on the classpath of the compiler.

Try something like this:
javac -classpath opennlp-tools-1.5.0.jar Test.java

Then it will be able to find the referenced ChunkSample class.

Hope that helps,
Jörn


On 12/7/10 7:14 PM, Congmin min wrote:

Hello, I am new to this tools. I downloaded 1.5 version, and added the 3
jar
files into my windows 7 environment variable:
C:\Program Files\Apache Software Foundation\Tomcat
7.0\webapps\nlpTools\WEB-INF\classes\nlpTools\openNLP\lib\jwnl-1.3.3.jar;
C:\Program Files\Apache Software Foundation\Tomcat
7.0\webapps\nlpTools\WEB-INF\classes\nlpTools\openNLP\lib\maxent-3.0.0.jar;
C:\Program Files\Apache Software Foundation\Tomcat

7.0\webapps\nlpTools\WEB-INF\classes\nlpTools\openNLP\lib\opennlp-tools-1.5.0.jar

Then I wrote a helloWorld.java to test it, but it says the package can't be
found:

import opennlp.tools.chunker.ChunkSample;

public class Test{
     public static void main(String[] args) {
         System.out.println(" NLP tools ... ");
}


c:\>javac Test.java
Test.java:1: package opennlp.tools.chunker does not exist
import opennlp.tools.chunker.ChunkSample;
                             ^
1 error

Where was I wrong? Thanks.



Reply via email to