Hi,

I'm using inline::java to run code for a version based product. I now
have a need to support two versions of the same code in the same script.
My problem is that the to versions conflict with each other. So, having
both versions specified in the same classpath causes each versions use
to break. If I use one version or the other I'm fine. 

Is there a way with inline::java to run two different environments? I am
using a shared environment, but I suppose I don't need to. 

CLASSPATH is currently set in the .profile for the user (unix) running
the process.

use Inline::Java qw(study_classes) ;
use Inline JAVA => 'STUDY', SHARED_JVM => 1, STUDY => [], DEBUG => 1; 

I tried this:

use Inline::Java qw(study_classes) ;
use Inline JAVA => 'STUDY', SHARED_JVM => 1, STUDY => [], DEBUG => 1,
CLASSPATH => $ENV{VERSION2CLASSES}; 

But I could not switch to $ENV{VERSION3CLASSES}

Tried this - didn't work:

sub sub1 {
        undef $ENV{CLASSPATH};
        $ENV{CLASSPATH} = $ENV{VERSION2CLASSES};
        do something inline'ish with version2
}

sub sub2 {
        undef $ENV{CLASSPATH};
        $ENV{CLASSPATH} = $ENV{VERSION3CLASSES};
        do something inline'ish with version3
}

Thank you in advance,
Mike

Reply via email to