Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java Eclipse: Programmatically import plug-ins and fragments

I need to programmatically import a .jar in my workspace as I do when I use the menu:
Import -> Plug-in development -> Plug-ins and Fragments.

Here I find the code for import a java project:

IProjectDescription description = ResourcesPlugin.getWorkspace().loadProjectDescription( new Path("PROJECT_PATH/.project"));

IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(description.getName());

project.create(description, null);
project.open(null);

But I don't have .project on .jar file. Can you help me?

Thanks

like image 537
francesco pasini Avatar asked Jul 17 '12 15:07

francesco pasini


1 Answers

You are close, do all of that and then create an IFile object and read the Jar file into the IFile object. The documentation has some helpful snippets of code to show you how to do this.

like image 133
Francis Upton IV Avatar answered Nov 02 '22 07:11

Francis Upton IV