1

I installed a new plugin for Eclipse (named AgentZero). I imported a project using MercurialEclipse, and the importing was ok. Now, while programming this project, there is no compilation. In addition, there is no auto-complete. When I am trying to use auto-complete, I get the following message: "This compilation unit is not on the build path of a Java project". Afterwards, I get this message: "The 'org.eclipse.ui.JavaAllCompletionProposalComputer' proposal computer from 'org.eclipse.jdt.ui' plug-in did not complete normally. The extension took too long to return from the 'computeCompletionProposals()' operation. To avoid thus message, diable the 'org.eclipse.jdt.ui' plug-in or disable the 'Java Proposals' category int the content assist preference page."

All the other projects are fine. What can I do? Thank you

Aviv N
  • 13
  • 4

1 Answers1

0

You need to check, whether the import has correctly configured the project as a Java project.

Is it a Java project?

  • Does it have a "J" overlay on the project icon?
  • Does it have pages like Java Build Path & Java Compiler in the project's property dialog?
  • On the Builders property page, does it show "Java Builder" and is that entry checked?

Are the source folders correctly configured?

  • Check Java Build Path > Source in the project's properties
  • Make sure there are no unwanted inclusion/exclusion filters.

If any of these is missing or has errors, JDT lacks context for proposing any code completions -- hence the error dialog you are seeing.

I can't advise regarding AgentZero, nor did you specify how this plugin relates to the problem.

If the above doesn't resolve the issue, you should look for recent entries in the Error Log.

EDIT:

If indeed the project is not correctly configured as a Java project, it might be interesting to know how you got into this situation. If, e.g., you simply forgot to select an option during project import, starting over might be the cleanest option. If, OTOH, the import tool failed to do, what it was supposed do, you may want to report a bug (against MercurialEclipse in this case).

If the problem cannot be fixed by re-importing, a few careful modifications of project configuration files might get you back on track. In this case I suggest to create a fresh plain Java project and use the created configuration as a reference for your repair.

For this you should know the purpose of these files (which all are by default hidden in the Package Explorer, due to the ".* resources" filter):

.project

This file should attach the Java nature to the project. This is how Eclipse recognizes a project as a Java project. Additionally, .project declares all builders that are automatically invoked. Adding nature and builder (if absent) is a safe operation and might already fix your issues. Check the result in the project properties dialog.

.classpath

Here Eclipse stores everything you configured on the Java Build Path property page. Since the content of this file very much depends on how you manage dependencies (e.g., using Maven?), no general advice can be given. If possible use the properties dialog rather than manual editing.

.settings/org.eclipse.jdt.core.prefs

Here JDT stores all further configuration options, like compiler options.

Stephan Herrmann
  • 7,963
  • 2
  • 27
  • 38
  • Thank you, the first 3 things you mentioned are right regarding this project. There is no Java Build path in the project's properties. Do you have any suggestion of how to fix it? – Aviv N May 03 '15 at 07:38