Call internal exe file

Hello,

 

I want to call a executable file in my node. It is in my src/ folder but I can't get his relative path. I read topics about Bundle, but it's difficult to find the documentation or tutorials. Moreover, I feel a heavy mechanism for just a little executable file...

There is a simple way ?

 

Regards,

Maxime

Install the "Sources for KNIME Chemistry Add-Ons" and have a look at org.knime.ext.chem.openbabel.BabelActivator. This is the easiest way to retrieve packaged executables.

Thank you very much ! It's works fine for me

Regards

I may have spoken too soon...

In Knime SDK, I have no problem. My executable file is correctly found.

But when I export node with "Deployable plug-ins and fragments", Knime does not find it.

In method getBundle().findEntries(path, filePattern, recurse), I try with path "/", "./" and os + "/" + arch

I have an architecture linux x86

 

Any ideas ?

Regards

Is the directory with the executables included in the binary build?

Yes, I have even tried several path.

And I anticipate a second problem : I feel that my executable has "lost" his permission executable. In my project (Knime SDK), my file is executable, but when I export project, it is not any more.

Add a META-INF/p2.inf file to your plug-in with contents similar to this:

instructions.install=\
    org.eclipse.equinox.p2.touchpoint.eclipse.chmod(targetDir:@artifact,\
    targetFile:linux/x86/babel,permissions:755);

 

See also http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Fguide%2Fp2_actions_touchpoints.html

I don't see where @artifact points.

My jar file has this structure :

org.mybabel_1.0.0/

    mybabel/

        META-INF/

        org/

            mybabel/

                MyBabelActivator.class

    META-INF/

        p2.inf

 

Where @artifact points ?

 

Regards

@artifact is an identifier, you don't need to change it.

I don't want to change it, it is just that "targetFile:linux/x86/myBabel" doesn't seem work for me, whatever location of myBabel in project. I tried too "targetFile:/myBabel" and "targetFile:./myBabel". But as I don't see where @artificats points, it is not easy to debug

It points to the root of the plug-in.

Thanks. So, I don't understand why chmod doesn't work.

I tried "targetFile:linux/x86/myBabel", "targetFile:/myBabel" and "targetFile:./myBabel" with several location for myBabel :

org.mybabel_1.0.0/

    myBabel

    mybabel/

        META-INF/

        org/

            mybabel/

                MyBabelActivator.class

                myBabel

    META-INF/

        p2.inf

 

Any ideas ?

If you mean the first bold "myBabel" entry then it's just "targetFile:myBabel". The targetFile path is relative to the targetDir.

 

It is not working for me... And if I do not make a mistake, here we just try to change permissions. But it is also necessary that activator find the file with getBundle().findEntries(...), right ? Yet this does not work either. It is not bound ?
 

Is the executable really part of the binary build? In the correct location? This works without any problems in many KNIME plug-ins therefore you must have a configuration error somehwere.

Sorry for the late response. I created a new project, and the problem his solved. Probably a configuration error, indeed.

Thank you very much for your patience

Regards