You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by liat oren <or...@gmail.com> on 2009/03/17 11:20:27 UTC

Luke - Build a jar that uses my own jar

Hi,

I edited Luke's code so it also uses my classes (I added the jar to the
class-path and put it in the lib folder).
When I run from java it works good.

Now I try to build it and invoke Luke's jar outside java and get the
following error:
Exception in thread "main" java.lang.NoClassDefFoundError: - on my classes.

What do I do wrong?
Thanks,
Liat

Re: Luke - Build a jar that uses my own jar

Posted by liat oren <or...@gmail.com>.
I work on windows.

I copied my jar to the lib directory - so it is now together with the other
jars Luke uses (Lucene, etc)
And added the text below to the classpath file (exists in the luke-src-0.9.1
directory).



2009/3/17 Ian Lea <ia...@gmail.com>

> Added that classpathentry to what?  That means nothing to me.
>
> I'd run it from the command line as
>
> $ java -cp whatever -jar whatever.jar
>
> or
>
> $ export CLASSPATH=whatever
> $ java -jar whatever.jar
>
> Those examples are unix based.  If you're on Windows I imagine there
> are equivalents.  Or maybe your classpathentry is some Windows thing -
> in which case I can't help.
>
>
> --
> Ian.
>
>
> On Tue, Mar 17, 2009 at 10:55 AM, liat oren <or...@gmail.com> wrote:
> > Hi Ian,
> >
> > Thanks for  the answer.
> > Yes, I meant running in from command line.
> >
> > They are already in the classpath - I added this part:
> > <classpathentry kind="lib" path="lib/myJar.jar"/>
> >
> >
> > 2009/3/17 Ian Lea <ia...@gmail.com>
> >
> >> Well, assuming that when you say "invoke Luke's jar outside java" you
> >> mean that you are trying to run Luke from the command line e.g. $ java
> >> -jar lukexxx.jar, it simply sounds like your classes are not on the
> >> classpath.  Add them.
> >>
> >>
> >> --
> >> Ian.
> >>
> >>
> >> On Tue, Mar 17, 2009 at 10:20 AM, liat oren <or...@gmail.com>
> wrote:
> >> > Hi,
> >> >
> >> > I edited Luke's code so it also uses my classes (I added the jar to
> the
> >> > class-path and put it in the lib folder).
> >> > When I run from java it works good.
> >> >
> >> > Now I try to build it and invoke Luke's jar outside java and get the
> >> > following error:
> >> > Exception in thread "main" java.lang.NoClassDefFoundError: - on my
> >> classes.
> >> >
> >> > What do I do wrong?
> >> > Thanks,
> >> > Liat
> >> >
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> >> For additional commands, e-mail: java-user-help@lucene.apache.org
> >>
> >>
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

Re: Luke - Build a jar that uses my own jar

Posted by Ian Lea <ia...@gmail.com>.
Added that classpathentry to what?  That means nothing to me.

I'd run it from the command line as

$ java -cp whatever -jar whatever.jar

or

$ export CLASSPATH=whatever
$ java -jar whatever.jar

Those examples are unix based.  If you're on Windows I imagine there
are equivalents.  Or maybe your classpathentry is some Windows thing -
in which case I can't help.


--
Ian.


On Tue, Mar 17, 2009 at 10:55 AM, liat oren <or...@gmail.com> wrote:
> Hi Ian,
>
> Thanks for  the answer.
> Yes, I meant running in from command line.
>
> They are already in the classpath - I added this part:
> <classpathentry kind="lib" path="lib/myJar.jar"/>
>
>
> 2009/3/17 Ian Lea <ia...@gmail.com>
>
>> Well, assuming that when you say "invoke Luke's jar outside java" you
>> mean that you are trying to run Luke from the command line e.g. $ java
>> -jar lukexxx.jar, it simply sounds like your classes are not on the
>> classpath.  Add them.
>>
>>
>> --
>> Ian.
>>
>>
>> On Tue, Mar 17, 2009 at 10:20 AM, liat oren <or...@gmail.com> wrote:
>> > Hi,
>> >
>> > I edited Luke's code so it also uses my classes (I added the jar to the
>> > class-path and put it in the lib folder).
>> > When I run from java it works good.
>> >
>> > Now I try to build it and invoke Luke's jar outside java and get the
>> > following error:
>> > Exception in thread "main" java.lang.NoClassDefFoundError: - on my
>> classes.
>> >
>> > What do I do wrong?
>> > Thanks,
>> > Liat
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
>> For additional commands, e-mail: java-user-help@lucene.apache.org
>>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: Luke - Build a jar that uses my own jar

Posted by liat oren <or...@gmail.com>.
Hi Ian,

Thanks for  the answer.
Yes, I meant running in from command line.

They are already in the classpath - I added this part:
<classpathentry kind="lib" path="lib/myJar.jar"/>


2009/3/17 Ian Lea <ia...@gmail.com>

> Well, assuming that when you say "invoke Luke's jar outside java" you
> mean that you are trying to run Luke from the command line e.g. $ java
> -jar lukexxx.jar, it simply sounds like your classes are not on the
> classpath.  Add them.
>
>
> --
> Ian.
>
>
> On Tue, Mar 17, 2009 at 10:20 AM, liat oren <or...@gmail.com> wrote:
> > Hi,
> >
> > I edited Luke's code so it also uses my classes (I added the jar to the
> > class-path and put it in the lib folder).
> > When I run from java it works good.
> >
> > Now I try to build it and invoke Luke's jar outside java and get the
> > following error:
> > Exception in thread "main" java.lang.NoClassDefFoundError: - on my
> classes.
> >
> > What do I do wrong?
> > Thanks,
> > Liat
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>

Re: Luke - Build a jar that uses my own jar

Posted by Ian Lea <ia...@gmail.com>.
Well, assuming that when you say "invoke Luke's jar outside java" you
mean that you are trying to run Luke from the command line e.g. $ java
-jar lukexxx.jar, it simply sounds like your classes are not on the
classpath.  Add them.


--
Ian.


On Tue, Mar 17, 2009 at 10:20 AM, liat oren <or...@gmail.com> wrote:
> Hi,
>
> I edited Luke's code so it also uses my classes (I added the jar to the
> class-path and put it in the lib folder).
> When I run from java it works good.
>
> Now I try to build it and invoke Luke's jar outside java and get the
> following error:
> Exception in thread "main" java.lang.NoClassDefFoundError: - on my classes.
>
> What do I do wrong?
> Thanks,
> Liat
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org