• Problems with setting the path to nativeview.dll
Replies:
3
Views:
225
Up one level
• Problems with setting the path to nativeview.dll
Posted by
Yadis
at
2010-01-26 16:30:01
Hey.
I am using NOA 2.2.2 with Eclipse 3.5.1 and Java 6U17. Currenty I am writing an Eclipse plugin where I want to include the support to open and edit OpenOffice documents. I read the tutorials and got it to work. However, for some reason I had to manually move the nativeview.dll inside my Eclipse folder. Basically NOA insited that the nativeview.dll is in &eclipse_dir&/lib/nativeview.dll I tried setting the build path as well as the plugin classpaths, nothing worked. After exporting my plugin, the nativeview.dll is in the folder /lib/NOA inside the plugin.jar. I then tried the hint from the wiki to use System.setProperty(IOfficeApplication.NOA_NATIVE_LIB_PATH,"/your/lib/folder" but then I get an error saying that I need to provide an absolute path. I am fairly sure I am just not seeing the obvious here, but any help would be welcome. Thanks in advance |
Yadis
Member
Posts:
8
|
• Re: Problems with setting the path to nativeview.dll
Posted by
Markus Krueger
at
2010-01-26 17:09:08
Hi,
you need to do the following in your plugin's start method:
public void start(BundleContext context) throws Exception {
super.start(context);
System.setProperty(IOfficeApplication.NOA_NATIVE_LIB_PATH,getLibrariesLocation());
}
public String getLibrariesLocation() {
if(librariesLocation == null) {
try {
URL url = Platform.getBundle("com.your.bundle.id").getEntry("/");
url = FileLocator.toFileURL(url);
String bundleLocation = url.getPath();
File file = new File(bundleLocation);
bundleLocation = file.getAbsolutePath();
bundleLocation = bundleLocation.replace('/', File.separatorChar) + File.separator + "lib";
librariesLocation = bundleLocation;
}
catch(Throwable throwable) {
return null;
}
}
return librariesLocation;
}
Hope this helps. Regards, Markus |
• Re: Problems with setting the path to nativeview.dll
Posted by
Yadis
at
2010-01-26 17:24:48
It looks like it's the right way, but I must be really tired...
I now get java.lang.UnsatisfiedLinkError: Can't load library: G:\workspace\plugin\lib/nativeview.dll so the last '/' prevents this method from working, but I don't see a way to influence this. It seems like it is automatically set to use the Unix separator. |
Yadis
Member
Posts:
8
|
• Re: Problems with setting the path to nativeview.dll
Posted by
Yadis
at
2010-01-27 08:13:13
Ok, it's working now. As I said, it has been a long day yesterday and I set the path wrong...
Thank you Markus for the fast help, I really appreciate it. |
Yadis
Member
Posts:
8
|


