From filipp.zhinkin at oracle.com Wed Nov 19 12:50:36 2014 From: filipp.zhinkin at oracle.com (Filipp Zhinkin) Date: Wed, 19 Nov 2014 16:50:36 +0400 Subject: Test's classpath and jar's from $JDK_HOME/lib/ Message-ID: <546C921C.6060208@oracle.com> Hi, it there a way to put jars from $JDK_HOME/lib/ (sa-jdi.jar for example) into test's classpath like it is possible to do with jars from a location relative to TEST.ROOT or test.src using @library tag? Of course it is possible to write custom driver class that will copy required jars to CWD or will wrap javac and java commands and will itself substitute required jars to their classpaths. But maybe a simpler approach already exist? // BTW, $JDK_HOME/lib/tools.jar is already in tests' classpath. ;) Thanks in advance, Filipp. From jonathan.gibbons at oracle.com Wed Nov 19 18:56:52 2014 From: jonathan.gibbons at oracle.com (Jonathan Gibbons) Date: Wed, 19 Nov 2014 10:56:52 -0800 Subject: Test's classpath and jar's from $JDK_HOME/lib/ In-Reply-To: <546C921C.6060208@oracle.com> References: <546C921C.6060208@oracle.com> Message-ID: <546CE7F4.3040000@oracle.com> On 11/19/2014 04:50 AM, Filipp Zhinkin wrote: > Hi, > > it there a way to put jars from $JDK_HOME/lib/ (sa-jdi.jar for example) > into test's classpath like it is possible to do with jars from a location > relative to TEST.ROOT or test.src using @library tag? > > Of course it is possible to write custom driver class that will copy > required jars to CWD or will wrap javac and java commands and > will itself substitute required jars to their classpaths. > > But maybe a simpler approach already exist? > > // BTW, $JDK_HOME/lib/tools.jar is already in tests' classpath. ;) > > Thanks in advance, > Filipp. Just checking -- I presume these jar files are not on the standard bootclasspath, right? If not, then right now, there is no easy way to do this. -- Jon From filipp.zhinkin at oracle.com Fri Nov 21 09:13:02 2014 From: filipp.zhinkin at oracle.com (Filipp Zhinkin) Date: Fri, 21 Nov 2014 13:13:02 +0400 Subject: Test's classpath and jar's from $JDK_HOME/lib/ In-Reply-To: <546CE7F4.3040000@oracle.com> References: <546C921C.6060208@oracle.com> <546CE7F4.3040000@oracle.com> Message-ID: <546F021E.9070207@oracle.com> On 11/19/2014 10:56 PM, Jonathan Gibbons wrote: > > On 11/19/2014 04:50 AM, Filipp Zhinkin wrote: >> Hi, >> >> it there a way to put jars from $JDK_HOME/lib/ (sa-jdi.jar for example) >> into test's classpath like it is possible to do with jars from a location >> relative to TEST.ROOT or test.src using @library tag? >> >> Of course it is possible to write custom driver class that will copy >> required jars to CWD or will wrap javac and java commands and >> will itself substitute required jars to their classpaths. >> >> But maybe a simpler approach already exist? >> >> // BTW, $JDK_HOME/lib/tools.jar is already in tests' classpath. ;) >> >> Thanks in advance, >> Filipp. > > > Just checking -- I presume these jar files are not on the standard > bootclasspath, right? Right. > > If not, then right now, there is no easy way to do this. That's sad. Thanks, Filipp. > > -- Jon From jonathan.gibbons at oracle.com Fri Nov 21 18:14:07 2014 From: jonathan.gibbons at oracle.com (Jonathan Gibbons) Date: Fri, 21 Nov 2014 10:14:07 -0800 Subject: Test's classpath and jar's from $JDK_HOME/lib/ In-Reply-To: <546F021E.9070207@oracle.com> References: <546C921C.6060208@oracle.com> <546CE7F4.3040000@oracle.com> <546F021E.9070207@oracle.com> Message-ID: <546F80EF.7000802@oracle.com> On 11/21/2014 01:13 AM, Filipp Zhinkin wrote: > On 11/19/2014 10:56 PM, Jonathan Gibbons wrote: >> >> On 11/19/2014 04:50 AM, Filipp Zhinkin wrote: >>> Hi, >>> >>> it there a way to put jars from $JDK_HOME/lib/ (sa-jdi.jar for example) >>> into test's classpath like it is possible to do with jars from a >>> location >>> relative to TEST.ROOT or test.src using @library tag? >>> >>> Of course it is possible to write custom driver class that will copy >>> required jars to CWD or will wrap javac and java commands and >>> will itself substitute required jars to their classpaths. >>> >>> But maybe a simpler approach already exist? >>> >>> // BTW, $JDK_HOME/lib/tools.jar is already in tests' classpath. ;) >>> >>> Thanks in advance, >>> Filipp. >> >> >> Just checking -- I presume these jar files are not on the standard >> bootclasspath, right? > Right. >> >> If not, then right now, there is no easy way to do this. > That's sad. > > Thanks, > Filipp. >> >> -- Jon > The sadness exists on multiple fronts. jtreg has been around since about 1997, and no-one has wanted this feature up to now. On one hand, we can look at adding this feautre into jtreg. On the other hand, these jars are going away in JDK9, to be replaced by "the Java module system" (i.e. all the Jigsaw work now going on.) How big is your use case, so that we can compare and prioritize possible solutions, such as jtreg support vs. cutsom driver support? -- Jon From jonathan.gibbons at oracle.com Fri Nov 21 18:24:07 2014 From: jonathan.gibbons at oracle.com (Jonathan Gibbons) Date: Fri, 21 Nov 2014 10:24:07 -0800 Subject: Test's classpath and jar's from $JDK_HOME/lib/ In-Reply-To: <546F80EF.7000802@oracle.com> References: <546C921C.6060208@oracle.com> <546CE7F4.3040000@oracle.com> <546F021E.9070207@oracle.com> <546F80EF.7000802@oracle.com> Message-ID: <546F8347.6010301@oracle.com> On 11/21/2014 10:14 AM, Jonathan Gibbons wrote: > > On 11/21/2014 01:13 AM, Filipp Zhinkin wrote: >> On 11/19/2014 10:56 PM, Jonathan Gibbons wrote: >>> >>> On 11/19/2014 04:50 AM, Filipp Zhinkin wrote: >>>> Hi, >>>> >>>> it there a way to put jars from $JDK_HOME/lib/ (sa-jdi.jar for >>>> example) >>>> into test's classpath like it is possible to do with jars from a >>>> location >>>> relative to TEST.ROOT or test.src using @library tag? >>>> >>>> Of course it is possible to write custom driver class that will copy >>>> required jars to CWD or will wrap javac and java commands and >>>> will itself substitute required jars to their classpaths. >>>> >>>> But maybe a simpler approach already exist? >>>> >>>> // BTW, $JDK_HOME/lib/tools.jar is already in tests' classpath. ;) >>>> >>>> Thanks in advance, >>>> Filipp. >>> >>> >>> Just checking -- I presume these jar files are not on the standard >>> bootclasspath, right? >> Right. >>> >>> If not, then right now, there is no easy way to do this. >> That's sad. >> >> Thanks, >> Filipp. >>> >>> -- Jon >> > > The sadness exists on multiple fronts. jtreg has been around since > about 1997, and no-one has wanted this feature up to now. > > On one hand, we can look at adding this feautre into jtreg. On the > other hand, these jars are going away in JDK9, to be replaced by "the > Java module system" (i.e. all the Jigsaw work now going on.) > > How big is your use case, so that we can compare and prioritize > possible solutions, such as jtreg support vs. cutsom driver support? > > -- Jon > > > FWIW, /if/ we were to put this into jtreg, I could imagine extending the @library syntax with something like @library $JDK/lib/sa-jdi.jar jtreg does not currently do any such substitution, so we can bike-shed on that. An alternative is to extend the interpretation of @library /a/b/c. Current, an absolute path like that is interpreted relative to the root of the test directory. If that fails, we could look it up relative to the JDK. A combination of the two could be the following: @library/jdk lib/sa-jdi.jar -- Jon