Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Running extern binary(Want to include an external binary in a Plug-In and run it.)
Running extern binary [message #879224] Wed, 30 May 2012 19:41 Go to next message
Bertie Manta is currently offline Bertie MantaFriend
Messages: 1
Registered: May 2012
Junior Member
Hi everybody,

I need to run an external Win32 EXE file in one of my Eclipse RCP Plug-Ins. At the moment I'm using the
Runtime.getRuntime().exec("C:/abc.exe");
to run it and as you can see I unfortunately need an absolute path to the EXE file.
Now my question is, is there any solution to include the EXE file in a Eclipse RCP Plug-In and use a relative path? I know that if one use Java JNI to include extern C++ libs it is possible to include the C++ DLL in a Plug-In by specify the location of the JNI DLL like
System.loadLibrary("lib/nativelib");


So I hoped that I can do the same in the Runtime call
Runtime.getRuntime().exec("lib/abc.exe");
But this doesn't work.

Any idea or solution for this problem? How can I include my abc.exe in a Eclipse RCP Plug-In and call it with a relative path.
Re: Running extern binary [message #879236 is a reply to message #879224] Wed, 30 May 2012 20:08 Go to previous message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 5487
Registered: July 2009
Senior Member
Yes it should be possible the only thing you need to make sure is that
the bundle is exploded when installed.

You can do this useing the "Eclipse-BundleShape: dir" header in your
MANIFEST.MF - you can afterwards find the location of the bundle
directory using code like shown in [1] look at
createClassLoaderForDeployedPlugin how to find out the location of a bundle.

Tom

[1]https://github.com/tomsontom/e-fx-clipse/blob/master/at.bestsolution.efxclipse.runtime.osgi/src/at/bestsolution/efxclipse/runtime/osgi/fxloader/FXClassLoader.java

Am 30.05.12 21:41, schrieb Bertie Manta:
> Hi everybody,
>
> I need to run an external Win32 EXE file in one of my Eclipse RCP
> Plug-Ins. At the moment I'm using the
> Runtime.getRuntime().exec("C:/abc.exe"); to run it and as you can see I
> unfortunately need an absolute path to the EXE file. Now my question is,
> is there any solution to include the EXE file in a Eclipse RCP Plug-In
> and use a relative path? I know that if one use Java JNI to include
> extern C++ libs it is possible to include the C++ DLL in a Plug-In by
> specify the location of the JNI DLL like
> System.loadLibrary("lib/nativelib");
> So I hoped that I can do the same in the Runtime call
> Runtime.getRuntime().exec("lib/abc.exe"); But this doesn't work.
>
> Any idea or solution for this problem? How can I include my abc.exe in a
> Eclipse RCP Plug-In and call it with a relative path.
Previous Topic:Stack view with editor in eclipse 3.5.
Next Topic:Adding Plugin to RCP application
Goto Forum:
  


Current Time: Mon Dec 22 22:14:16 GMT 2014

Powered by FUDForum. Page generated in 0.01689 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software