user3569452
user3569452

Reputation: 59

Where is the CLASSPATH?

I would like to use the library "Lucene" with java. The instructions to use it tell me I have to put the jar's cointaining the classes inside the CLASSPATH.

The CLASSPATH is the directory containing all the default classes of Java? Or the directory of my specific project? I'm using Eclipse as IDE.

Really confused about that! Thank you.

USEFUL SOLUTION: http://www.avajava.com/tutorials/lessons/how-do-i-use-lucene-to-index-and-search-text-files.html

Upvotes: 2

Views: 3267

Answers (1)

Michael Borgwardt
Michael Borgwardt

Reputation: 346240

The Classpath is a collection of directories and JAR files inside which the Java runtime will look for classes.

It can be configured via an environment variable named CLASSPATH, but this usage is not recommended, as it tends to constantly result in problems.

The preferred way to configure the classpath when running a Java program is to pass it via the -cp command line switch when you start the Java interpreter. Usually you write a shell script so you don't have to type it out every time.

If your issue is with using the classes inside the IDE where you write your code, then it depends of course on the IDE. For eclipse, the "Java Build Path" tab of the project properties is where you configure the classpath.

Upvotes: 4

Related Questions