How to use OSGi fragments to contribute platform-dependent native code with the same filename?

前端 未结 3 512
南方客
南方客 2020-12-19 09:22

I am using the JNotify project to listen to file system events. This depends on one native library per OS:processor architecture. For example, there\'s one library for Windo

相关标签:
3条回答
  • 2020-12-19 10:01

    If you don't mind being restricted to Equinox you can use one-fragment-per-platform solution with Eclipse-PlatformFilter. In this case, only one fragment with native code can be resolved and installed at any time thus avoiding namespace conflict.

    0 讨论(0)
  • 2020-12-19 10:02

    Check what version of Eclipse/OSGi container are you running. I suspect you find that the container you are launching has os set to a 32 bit system.

    0 讨论(0)
  • 2020-12-19 10:08

    Since your fragment occupy the same resource namespace only one .so file can be accessed. You can deploy only one fragment, or you could try putting them in different directories:

     Fragment 32-bit:
     Include-Resource: x32/libjnotify.so=lib/libjnotify.so
    
     Fragment 64-bit:
     Include-Resource: x64/libjnotify.so=lib/libjnotify.so
    

    I also think you need to put the Bundle-NativeCode header in the host bundle and refer to the proper directories since I am I think this header is not merged in the host.

    0 讨论(0)
提交回复
热议问题