You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@harmony.apache.org by galaxy <ti...@gmail.com> on 2009/08/11 08:40:05 UTC

The support for - jar -cp ?

Hi all
I am working to support -jar in my work ,but it is always unable to find the
classes specified in the -cp xxx,
I happened to notice there is a line in native/launcher/shared/main.c in the
createVMArgs
/* Ignore classpath defines for -jar */
/* XXX -cp is accepted ??? */

So how should I do to include my classpath when using -jar ?
The -DDjava.class.path seems not useful too .
-- 
regards
Tian

Re: The support for - jar -cp ?

Posted by Aleksey Shipilev <al...@gmail.com>.
You should use JAR manifest [1] to set the classpath appropriately.

Aleksey.

[1] http://java.sun.com/docs/books/tutorial/deployment/jar/downman.html

On Tue, Aug 11, 2009 at 12:33 PM, galaxy<ti...@gmail.com> wrote:
> Thanks
> 2009/8/11 Charles Lee <li...@gmail.com>
>
>> It seems you should include all the classes and jars in the jar file.
>>
>> On Tue, Aug 11, 2009 at 3:30 PM, Charles Lee <li...@gmail.com>
>> wrote:
>>
>> > Hi galaxy,
>> >
>> > Here is what I found using man java:
>> > -jar:  When you use this option, the JAR file is the source of all user
>> > classes, and other user class path settings are ignored.
>> >
>> >
>> > On Tue, Aug 11, 2009 at 2:40 PM, galaxy <ti...@gmail.com> wrote:
>> >
>> >> Hi all
>> >> I am working to support -jar in my work ,but it is always unable to find
>> >> the
>> >> classes specified in the -cp xxx,
>> >> I happened to notice there is a line in native/launcher/shared/main.c in
>> >> the
>> >> createVMArgs
>> >> /* Ignore classpath defines for -jar */
>> >> /* XXX -cp is accepted ??? */
>> >>
>> >> So how should I do to include my classpath when using -jar ?
>> >> The -DDjava.class.path seems not useful too .
>> >> --
>> >> regards
>> >> Tian
>> >>
>> >
>> >
>> >
>> > --
>> > Yours sincerely,
>> > Charles Lee
>> >
>> >
>>
>>
>> --
>> Yours sincerely,
>> Charles Lee
>>
>
>
>
> --
> regards
> Tian
>

Re: The support for - jar -cp ?

Posted by galaxy <ti...@gmail.com>.
Thanks
2009/8/11 Charles Lee <li...@gmail.com>

> It seems you should include all the classes and jars in the jar file.
>
> On Tue, Aug 11, 2009 at 3:30 PM, Charles Lee <li...@gmail.com>
> wrote:
>
> > Hi galaxy,
> >
> > Here is what I found using man java:
> > -jar:  When you use this option, the JAR file is the source of all user
> > classes, and other user class path settings are ignored.
> >
> >
> > On Tue, Aug 11, 2009 at 2:40 PM, galaxy <ti...@gmail.com> wrote:
> >
> >> Hi all
> >> I am working to support -jar in my work ,but it is always unable to find
> >> the
> >> classes specified in the -cp xxx,
> >> I happened to notice there is a line in native/launcher/shared/main.c in
> >> the
> >> createVMArgs
> >> /* Ignore classpath defines for -jar */
> >> /* XXX -cp is accepted ??? */
> >>
> >> So how should I do to include my classpath when using -jar ?
> >> The -DDjava.class.path seems not useful too .
> >> --
> >> regards
> >> Tian
> >>
> >
> >
> >
> > --
> > Yours sincerely,
> > Charles Lee
> >
> >
>
>
> --
> Yours sincerely,
> Charles Lee
>



-- 
regards
Tian

Re: The support for - jar -cp ?

Posted by Charles Lee <li...@gmail.com>.
It seems you should include all the classes and jars in the jar file.

On Tue, Aug 11, 2009 at 3:30 PM, Charles Lee <li...@gmail.com> wrote:

> Hi galaxy,
>
> Here is what I found using man java:
> -jar:  When you use this option, the JAR file is the source of all user
> classes, and other user class path settings are ignored.
>
>
> On Tue, Aug 11, 2009 at 2:40 PM, galaxy <ti...@gmail.com> wrote:
>
>> Hi all
>> I am working to support -jar in my work ,but it is always unable to find
>> the
>> classes specified in the -cp xxx,
>> I happened to notice there is a line in native/launcher/shared/main.c in
>> the
>> createVMArgs
>> /* Ignore classpath defines for -jar */
>> /* XXX -cp is accepted ??? */
>>
>> So how should I do to include my classpath when using -jar ?
>> The -DDjava.class.path seems not useful too .
>> --
>> regards
>> Tian
>>
>
>
>
> --
> Yours sincerely,
> Charles Lee
>
>


-- 
Yours sincerely,
Charles Lee

Re: The support for - jar -cp ?

Posted by Charles Lee <li...@gmail.com>.
Hi galaxy,

Here is what I found using man java:
-jar:  When you use this option, the JAR file is the source of all user
classes, and other user class path settings are ignored.

On Tue, Aug 11, 2009 at 2:40 PM, galaxy <ti...@gmail.com> wrote:

> Hi all
> I am working to support -jar in my work ,but it is always unable to find
> the
> classes specified in the -cp xxx,
> I happened to notice there is a line in native/launcher/shared/main.c in
> the
> createVMArgs
> /* Ignore classpath defines for -jar */
> /* XXX -cp is accepted ??? */
>
> So how should I do to include my classpath when using -jar ?
> The -DDjava.class.path seems not useful too .
> --
> regards
> Tian
>



-- 
Yours sincerely,
Charles Lee