test.class.path.prefix?

Weijun Wang weijun.wang at oracle.com
Sat May 16 06:35:47 UTC 2015



On 5/16/2015 1:13 AM, Jonathan Gibbons wrote:
> On 05/14/2015 07:56 PM, Weijun Wang wrote:
>> I have a test A.java (in test/x) that uses B.java in @library test/y,
>> and the test is trying to spawn another Java process running itself
>> again (with a different arg). It also happens that inside test/x there
>> is a META-INF directory with services file I want to use.
>>
>> So, the child Java process should be able to see both A and B and
>> META-INF in its classpath.
>>
>> I notice that both A and B are compiled into WORKDIR/classes/x.
>
> This is not expected.  Do you have a line @build B?

No. Is that necessary?

If I add that line, I see B.class shown in WORKDIR/classes/y, and this 
path included in both test.class.path and test.class.path.prefix.

>
>>
>> So, how do I specify the -cp for the child process? I found this
>> system property which is perfect:
>>
>> - test.class.path.prefix: WORKDIR/classes/x and test/x
>>
>> However the name is quite strange, and it's not described at the end
>> of tag-spec.html. There are other system properties specified but none
>> is enough, although I can combine test.classes and test.src to get
>> what I need.
>>
>> Can test.class.path.prefix be supported?
>
> Does test.class.path not work for you?

No. It does not include test/x therefore the file in META-INF/services 
cannot be used.

--Max

>
>>
>> Thanks
>> Max
>


More information about the jtreg-dev mailing list