This is easy to do with the Maven java class plugin:

http://www.vineetmanohar.com/2009/11/3-ways-to-run-java-main-from-maven/

I have used this option many times.
mvn exec:java -Dexec.mainClass="my.class.name"

Using the Maven plugin is better because it loads all of the
dependencies into the classpath. If you go look at your $HOME/.m2
directory, you'll discover why this is nice :)

On Thu, Dec 22, 2011 at 10:28 PM, JAGANADH G <[email protected]> wrote:
> On Fri, Dec 23, 2011 at 11:17 AM, Ramprakash Ramamoorthy <
> [email protected]> wrote:
>
>> Dear all,
>>
>>            I have wrote my Java to invoke naive bayes classifier with the
>> desired parameters. I use eclipse with m2e plugin. My file is
>> ZClassifier.java and resides at
>> $MAHOUT_HOME/examples/src/main/java/org/apache/mahout/classifier/bayes.
>>
>>            I am able to run it from eclipse, but I am not able to do it
>> via command line. Kindly help me to run the same from the command line.
>>
>>
>
> Hi Ramaprakash
>
> These things are very basic java coding skill relates things.
>
> Simple tip : Convert your classifier code to an executable jar file with
> necessary libraries. Then run it like java -jar classifier.jar
> That is all
>
> --
> **********************************
> JAGANADH G
> http://jaganadhg.in
> *ILUGCBE*
> http://ilugcbe.org.in



-- 
Lance Norskog
[email protected]

Reply via email to