Thanks Patrick Quoting Patrick LeBoutillier <[EMAIL PROTECTED]>:
> On 11/29/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> > wrote: > > Hi, > > > > How can I use the CLASSPATH configuration option with Inline::Java? If, at > the > > beginning of the perl program, I add a line like: > > > > use Inline Java => 'CLASSPATH', CLASSPATH => > 'C:\Sonic\MQ6.1\lib\broker.jar'; > > > > perl complians as follows: > > > > > ---------------------------------------------------------------------------------- > > > > A problem was encountered while attempting to compile and install your > Inline > > Java code. The command that failed was: > > "C:\j2sdk1.4.2_10\bin\javac.exe" -deprecation -d > "C:\sonicMQ-Perl\_Inline\lib > > \auto\ShowQueues_pl_249a" ShowQueues_pl_249a.java > cmd.out 2>&1 > > > > The build directory was: > > C:\sonicMQ-Perl\_Inline\build\ShowQueues_pl_249a > > > > The error message was: > > ShowQueues_pl_249a.java:1: 'class' or 'interface' expected > > CLASSPATH > > ^ > > 1 error > > > > > > To debug the problem, cd to the build directory, and inspect the output > files. > > > > at C:\sonicMQ-Perl\ShowQueues.pl line 1 > > BEGIN failed--compilation aborted at C:\sonicMQ-Perl\ShowQueues.pl line 1. > > > > > -------------------------------------------------------------------------------- > > > > It looks like it is trying to build something!! > > Vishal, > > That's because since the scalar argument to Java is not 'DATA' (or > 'STUDY' in the case of Inline::Java), and Inline is assuming the > 'CLASSPATH' is the code you want to compile. > > My guess is that you do not want to write your own Java code but > rather use existing Java code. Here's how to do this: > > use Inline ( > Java => 'STUDY', > CLASSPATH = > 'C:\Sonic\MQ6.1\lib\broker.jar' > STUDY => ['some.class'], > ) ; > > my $obj = new some::class() ; > ... > > Note: In certain cases the CLASSPATH argument does not work (something > to do with ClassLoaders). In that case, use the environnement varible > with a BEGIN block: > > BEGIN { > $ENV{'CLASSPATH'} = 'C:\Sonic\MQ6.1\lib\broker.jar' ; > } > > use Inline ( > Java => 'STUDY', > STUDY => ['some.class'], > ) ; > > my $obj = new some::class() ; > # ... > > > Patrick > > > > > Thank you for the help. > > > > Vishal > > > > > > ---------------------------------------- > > This mail sent through www.mywaterloo.ca > > > > > -- > ===================== > Patrick LeBoutillier > Laval, Québec, Canada > ---------------------------------------- This mail sent through www.mywaterloo.ca