Bonjour,
je développe sous windows, pour un plugin windows, mais quand je tente de charger une dll dans mon plugin, il la cherche sur un path "linux".
A la sortie de tout ça, dans la variable path, j'ai
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13 public void start(BundleContext context) throws Exception { super.start(context); String path; // build OJAWA path String os = java.lang.System.getProperty("os.name"); if(os.equals("Linux")){ path = FileLocator.toFileURL(FileLocator.find(context.getBundle(), new Path("/"), null)).getPath(); path = path + "/libotawa/lib/libojawa.so"; } else if(os.startsWith("Windows")){ path = FileLocator.toFileURL(FileLocator.find(context.getBundle(), new Path(""), null)).toString(); path = path + "libotawa/bin/libojawa.dll"; }
Donc j'ai le / avant D: qui "gêne".
Code : Sélectionner tout - Visualiser dans une fenêtre à part /D:/Lecourt/workspace/ADTREE/libotawa/bin/libojawa.dll
D'où vient-il ?
D'après ce que j'ai lu dans la javadoc, le BundleContext est crée par Eclipse et représente l'environnement à ce moment là.
Partager