Skip Menu |

This queue is for tickets about the Inline-Java CPAN distribution.

Report information
The Basics
Id: 92761
Status: resolved
Priority: 0/
Queue: Inline-Java

People
Owner: Nobody in particular
Requestors: brabec [...] ncsu.edu
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.53
Fixed in: (no value)



Subject: Cannot use wildcards in CLASSPATH
Inline-Java-0.53 This is perl, v5.10.1 (*) built for x86_64-linux-thread-multi java version "1.7.0_45" Java(TM) SE Runtime Environment (build 1.7.0_45-b18) Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode) I am trying to access an Oracle library that is spread among a list of jar files. When I specify my CLASSPATH => '/home/oracle/oimclient/lib/*', the current module rejects that path because it does not pass the '-e' test. If I specify the directory, without the wildcard, as '/home/oracle/oimclient/lib/' it gets included in the path, but then the java compiler does not look for the jar files in that directory. I can fix this problem two ways. 1) Explicitly list out each jar file in the class path. This works, and is probably safer coding. 2) Patch the Java::Portable::make_classpath() code to look for wildcard directory entries and keep them in the passed CLASSPATH. The attached patch is my solution for this.
Subject: wildcard_classpath.patch
diff -uNr Inline-Java-0.53.orig/Java/Portable.pm Inline-Java-0.53/Java/Portable.pm --- Inline-Java-0.53.orig/Java/Portable.pm 2011-01-09 08:16:03.000000002 -0500 +++ Inline-Java-0.53/Java/Portable.pm 2014-02-05 14:12:09.000000002 -0500 @@ -58,7 +58,17 @@ my @fcp = () ; my %cp = map {$_ => 1} @cp ; foreach my $p (@cp){ - if (($p)&&(-e $p)){ + if ($p =~ m{\A(.*)/\*\z}) { + my $d = $1; + if (($d)&&(-d $d)){ + my $fp = Inline::Java::Portable::portable("SUB_FIX_JAVA_PATH", + File::Spec->rel2abs($d)).'/*'; + + Inline::Java::debug(2, "keeping wildcard classpath as '$fp'") ; + push @fcp, $fp; + } + } + elsif (($p)&&(-e $p)){ if ($cp{$p}){ my $fp = File::Spec->rel2abs($p) ; push @fcp, Inline::Java::Portable::portable("SUB_FIX_JAVA_PATH", $fp) ;
Subject: Re: [rt.cpan.org #92761] Cannot use wildcards in CLASSPATH
Date: Sat, 8 Feb 2014 09:08:41 -0500
To: bug-Inline-Java [...] rt.cpan.org
From: Patrick LeBoutillier <patrick.leboutillier [...] gmail.com>
This seems like a reasonable idea. I'll look at the patch and apply it for the next release. Patrick On Feb 5, 2014 2:42 PM, "https://webauth.ncsu.edu/openid/brabec via RT" < bug-Inline-Java@rt.cpan.org> wrote: Show quoted text
> Wed Feb 05 14:42:36 2014: Request 92761 was acted upon. > Transaction: Ticket created by https://webauth.ncsu.edu/openid/brabec > Queue: Inline-Java > Subject: Cannot use wildcards in CLASSPATH > Broken in: 0.53 > Severity: Normal > Owner: Nobody > Requestors: brabec@ncsu.edu > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=92761 > > > > Inline-Java-0.53 > This is perl, v5.10.1 (*) built for x86_64-linux-thread-multi > java version "1.7.0_45" > Java(TM) SE Runtime Environment (build 1.7.0_45-b18) > Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode) > > I am trying to access an Oracle library that is spread among a list of jar > files. When I specify my CLASSPATH => '/home/oracle/oimclient/lib/*', the > current module rejects that path because it does not pass the '-e' test. If > I specify the directory, without the wildcard, as > '/home/oracle/oimclient/lib/' it gets included in the path, but then the > java compiler does not look for the jar files in that directory. > > I can fix this problem two ways. > 1) Explicitly list out each jar file in the class path. This works, and is > probably safer coding. > 2) Patch the Java::Portable::make_classpath() code to look for wildcard > directory entries and keep them in the passed CLASSPATH. The attached patch > is my solution for this. > > >
This was actually released as part of 0.53_90! Closing.