Search code examples
javaeclipse-plugin

Release eclipse plugin that bundles Linux binary


I created a plugin for eclipse that calls a binary file using the processBuilder. This all works great but when I package the plugin as a Jar the file permissions are gone and I cannot run it.

I read something that I should package the binary in a feature so can make it a root file and set permissions. Now I am unclear how to call this root file (what is the location).

How should I be doing this? after a few days of trying I am getting a bit desperate :S.

Basically, I want to create a plugin that calls a binary and uses the output in a view.


Solution

  • In a feature you can configure files to be copied in to the installation using the root and root.permissions directives in the build.properties file.

    At the simplest this might just be:

    root=file:myExecutable
    root.permissions.755=myExecutable
    

    Which will copy a myExecutable file from the feature folder to the installation root and set its permissions to 755.

    In your plug-in you can use org.eclipse.core.runtime.Platform to find out the install root location:

    URL rootURL = Platform.getInstallLocation().getURL();