Why do you need the physical location of the system bundle?  This is going 
to vary greatly for each framework implementation.  Some implementations 
may not be contained in a single jar.  They could be in some proprietary 
format or built into the VM.  If they are in a single jar you could do 
something like this ...

BundleContext.class.getProtectionDomain().getCodeSource().getLocation()

This only tells you the jar or directory that was used to load the 
BundleContext class from and only works reliably if the framework was 
loaded with a URLClassLoader. 

Tom





"Pernet, Olivier" <[EMAIL PROTECTED]> 
Sent by: [EMAIL PROTECTED]
07/26/2007 09:52 AM
Please respond to
OSGi Developer Mail List <[email protected]>


To
<[email protected]>
cc

Subject
[osgi-dev] Retrieving the location of the system bundle






Hi,

Related to my previous question to this group, I now need to retrieve
the location of the system bundle from my running bundle, to be able to
start a new Java process launching the framework JAR. I've been doing
that on Equinox/Linux by using the osgi.framework system property.
This worked fine until I tested on Windows... Here the URL is a bit
bogus and needs taking care of.
So I'm wondering if there's a better, standard way of doing this ?

Thanks for your help,
- Olivier

_______________________________________________
OSGi Developer Mail List
[email protected]
http://www2.osgi.org/mailman/listinfo/osgi-dev

_______________________________________________
OSGi Developer Mail List
[email protected]
http://www2.osgi.org/mailman/listinfo/osgi-dev

Reply via email to