aspose file tools
The moose likes Beginning Java and the fly likes Classpath includes JAR file, so what's the problem? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "Classpath includes JAR file, so what Watch "Classpath includes JAR file, so what New topic
Author

Classpath includes JAR file, so what's the problem?

Marvin Humphrey
Greenhorn

Joined: Jan 09, 2009
Posts: 3
Greets,

I'm fluent in several other programming languages, and I've ported a huge
project from Java to C/Perl (Apache Lucene => KinoSearch), so I understand
Java reasonably well on a theoretical level. However, since I've never used
Java to build anything professionally, my practical knowledge is rudimentary
at best.

Right now, my goal is to benchmark a patch against the Apache Lucene library.
Here's a high level summary that illustrates where I've gotten to.

In other words, I can make my changes to the library (including new JUnit test
cases) and get "ant test" to run successfully.

The next step is to run the benchmark. According to the javadocs
(http://lucene.apache.org/java/2_4_0/api/contrib-benchmark/org/apache/lucene/benchmark/byTask/Benchmark.html), the
proper command line incantation is: "java Benchmark algorithm-file".

So... I build both the core library and "contrib/benchmark", set my CLASSPATH,
and attempt to run one of the algorithm files:

The output seems obviously indicative of a classpath problem.


I must be making an elementary mistake. What is it?

I've read the FAQ on CLASSPATH and the Sun documentation, and specifying the
full path to the JAR ought to do the trick, right?
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24057
    
  13

I looked at the Javadoc link you provided -- thanks, that makes it easy.

The class is named "org.apache.lucene.benchmark.byTask.Benchmark", so to run it -- despite what the Javadoc says -- you actually have to say




[Jess in Action][AskingGoodQuestions]
Marvin Humphrey
Greenhorn

Joined: Jan 09, 2009
Posts: 3
Thank you, that did the trick. I'm now getting errors I know how to solve.
Marvin Humphrey
Greenhorn

Joined: Jan 09, 2009
Posts: 3
Should I point out this documentation glitch to the Lucene dev list? Is there any situation under which the documented form could work correctly?
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24057
    
  13

Marvin Humphrey wrote:Should I point out this documentation glitch to the Lucene dev list? Is there any situation under which the documented form could work correctly?


No, that would never be the correct command line; you can confidently report this as a doc error.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Classpath includes JAR file, so what's the problem?
 
Similar Threads
Not able to display starting jsp page index.jsp
ANT and JUnit fork problem
ant build doubt
Submission Jar: test case + Ant build script
B Eckel's build.xml and mine