I've started research on developing for Eclipse. My intention is to make a suite to aid in the development of my custom game library. I have successfully created a "Hello World" example and am able to run successfully. I am adding to the project to test the eclipse plugin api, however, when I type IProject or IFile, both cannot be resolved to a type. I have tried Ctrl+Shift+I to auto-import, but no libraries are imported. Can someone please point me in direction where I might find the api / libs / jar / whatever to reference? Thanks
Asked
Active
Viewed 654 times
1 Answers
3
These classes are in the org.eclipse.core.resources
plugin. You must add this plugin to the 'Required Plug-ins' list on the 'Dependencies' page of the plugin.xml/MANIFEST.MF editor.
Note that you can only use these APIs in a Eclipse plugin, they can't be used in a plain Java project.

greg-449
- 109,219
- 232
- 102
- 145
-
How to find the plug-in that contains a specific class: [search for the class](https://wiki.eclipse.org/FAQ_How_do_I_find_a_particular_class_from_an_Eclipse_plug-in%3F) and look in the [breadcrumb](https://help.eclipse.org/oxygen/topic/org.eclipse.jdt.doc.user/reference/ref-java-editor-breadcrumb.htm) for the plug-in – howlger Jul 30 '17 at 20:50
-
**`org.eclipse.core.resources` can be used in a plain Java project**, e. g. together with `org.eclipse.equinox.commons` for path arithmetics (similar to NIO): `IPath p = new Path("foo"); String s = p.append("../bar/f.txt").segment(0); System.out.println(s); // bar` – howlger Jul 31 '17 at 06:52
-
@howlger That is a **very** limited use of the plugin. You cannot use the IFile and IProject classes referenced in the question since the workspace won't be initialized. – greg-449 Jul 31 '17 at 06:55
-
@greg-449 How about rephrasing the note? E. g. *Note, make sure your project is a [Plug-in project](http://help.eclipse.org/oxygen/topic/org.eclipse.pde.doc.user/guide/tools/project_wizards/new_plugin_project.htm) and will be run as part of an Eclipse application.* – howlger Jul 31 '17 at 07:15