harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Astapchuk <alex.astapc...@gmail.com>
Subject Re: [drlvm] Using JNI methods in VM's components.
Date Fri, 20 Oct 2006 11:24:52 GMT

Alex Astapchuk :
> Mikhail Fursov :
>> Pavel,
>> I do this workaround for my local needs.
>> The problem in your solution is dll name: gcv5
>> I can built my own version of GC - gcv5_plus_some_features and put it 
>> into
>> any directory I want (-Dvm.gc_dll ?)
>> Should I fix the Java sources in this case?
>>
>> The possible solution could be to set up system property: "-
>> Dgcv5.my_current_location" and read it from Java, but I see 2 problems:
>> 1) A component (GC) must know its library name
>> 2) "java.library.path" must be modified before the load and restored 
>> after
>> the load, because System.loadLibrary is not able to load library with 
>> fully
>> qualified path.
>>
>> Any other ideas?
> 
> Yeap.
> The following addresse both your issues.
> 
> 
> class GCv5Magics {
>      static {
>     String gcPath = System.getProperty("vm.gc_dll");
>     if (gcPath == null) {


... and the patch already exists... :-)

if (gcPath != null) {


>          System.load(gcPath);
>     }
>     else {
>          System.loadLibrary("gc.dll");
System.loadLibrary("gc");

>     }
>      }
>  }
> 
> 


-- 
Thanks,
   Alex


---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Mime
View raw message