3

I m doing an eclipse plugin project to create an IDE. I need to create a jar file for the plugin project in which i have four plugin packages which was created by me. Now I need these to be created as a single jar file and the user should be able to download the jar file and run my plugin project without the eclipse software.

karthigayan
  • 137
  • 4
  • 10

1 Answers1

3

EDIT- You cannot run Eclipse plugin outside of Eclipse, because you need the Equinox runtime container. you could run a plugin using the eclipse executable, and as an application, see:

http://wiki.eclipse.org/FAQ_How_do_I_create_an_application%3F

You're effectively creating an an org.eclipse.core.runtime.applications extension point.

You could also publish a plugin as part of an Eclipse application and then export it as an executable so that it can be run aside from Eclipse. This still bundles the Equinox runtime and plugin together though.

Also, check out "Running it outside of Eclipse" section here.

-END of EDIT

Generally, all you need to run an executable jar file is the jvm (java) and your code with all the classpath dependencies. You can use "Runnable Jar Export Wizard" available in Eclipse IDE when you right-click your project.
enter image description here

You can put all the dependencies inside your jar (for example you can create a lib directory in your project and put all your dependency jars inside). Also you will need to specify the dependecy location in the MANIFEST file that will be generated for your executable jar (if you use the wizard the MANIFEST file will contain your dependencies).

To run your executable jar you will need to execute:

java -jar jar-file

Good Luck!

aviad
  • 8,229
  • 9
  • 50
  • 98
  • @avaid should i implement the manifest file ion my own.how to add plugins as dependencies.will this jar after creation will work without eclipse? – karthigayan Mar 05 '12 at 08:52
  • it will be generated by the eclipse – aviad Mar 05 '12 at 08:52
  • how to add plugins as dependencies.will this jar after creation will work without eclipse? – karthigayan Mar 05 '12 at 08:53
  • The "Extract required libraries into generated jar" option on the snapsot above will do the job for you. Alternatively, you can see what jars are on your project build-path and copy them physically to some directory (lib?) inside your project. – aviad Mar 05 '12 at 08:57
  • @avaid it is asking for main function but there is no main functions in plugins project – karthigayan Mar 05 '12 at 11:17
  • @avaid so what u mean is i cant run my plugin without eclipse – karthigayan Mar 05 '12 at 11:30
  • @avaid what is the link u have given.what does it tell? – karthigayan Mar 05 '12 at 11:42
  • the link is the eclipse application creation guide. – aviad Mar 05 '12 at 11:46
  • equinox bundle is essential for running eclipse plugin. however, guote "You could also publish a plugin as part of an Eclipse application and then export it as an executable so that it can be run aside from Eclipse. This still bundles the Equinox runtime and plugin together though" – aviad Mar 05 '12 at 11:48
  • @avaid So i should combine both the equinox bundle and my plugin project to run the application.Can u tell me how to bundle them please i dono about the equinox bundle? – karthigayan Mar 05 '12 at 11:56
  • Check out "Running it outside of Eclipse" section http://www.eclipse.org/articles/Article-RCP-1/tutorial1.html – aviad Mar 05 '12 at 12:22