Eclipse CDT shows errors before project is built - eclipse

I am having a minor problem with Eclipse CDT Juno.
When I open up Eclipse for the first time, it will show many C/C++ Problem errors which put red x's on all of my projects. Many of these errors are "no such file or directory" errors for #include'd header files. However, after I clean and rebuild my projects, all of the errors go away.
I have double checked all of my indexer settings, and the index paths are pointing to the right place. I also believe the indexer is setup correctly because after a build, all of the "no such file or directory" errors are gone, and I can navigate through the source code without any red x's.
I have also tried Index->Rebuild and Index->Freshen All Files, but the only thing that will clear the errors is a clean/build.
I feel that I shouldn't have to rebuild all of my projects every time I open Eclipse. Any thoughts???

I was finally able to fix this by deleting the .metadata folder and rebuilding the workspace from scratch. What a pain, but at least my projects load without errors when I launch Eclipse.

Related

Eclipse Error: Cannot determine URI for /project-path/

I'm running Eclipse Luna on Ubuntu 12.0.4 in VirtualBox with a Windows 8 host and every once in a while, I will boot up Ubuntu and open up Eclipse to find this:
My projects should be listed in the package explorer but it's all empty and whenever I try to import the project again, it says no projects are found.
At this point, I usually go to my workspace folder and delete the .lock file and rebuild the workspace but is there an alternative to this? This error happens every ~5 times I reopen Eclipse and it has become very annoying. Any help will be appreciated!
EDIT: Okay I just tried deleting the .lock file in the .metadata folder in my workspace and I'm still getting the same error. Any suggestions?
EDIT 2: While closing my currently open tabs, I got this error. The projects that were open were Maven projects if that makes a difference.
so I am a little late for the party, but I fixed that on reimporting my projects.
Under File->Import.. you choose General->Import existing Projects into workspace. On the next page you set your workspace directory as the root directory for importing, which will give you a warning like "Some projects already exist in workspace". Ignore this and click finish.
After that all my projects where back in my workspace.
Good luck
To solve this problem, I re-created my workspace and imported my projects again.
Creating a new workspace is done via:
File > Switch Workspace
This is not an optimal solution, but until Eclipse fixes these bugs, this can save you some time trying to debug your current workspace.
I previously had a very small number of Eclipse plugins installed. So, I quickly headed to the Marketplace and installed my plugins.
And yes, Eclipse's downfall is expected. I personally find IntelliJ IDEs much better.

Eclipse CDT Intellisense Not Updating C++

I am working on a C++ project using Eclipse Kepler V4.3.1 with the CDT plugins on Fedora. Up until yesterday, everything seemed to be working fine, but now when I make a change Intellisense/Content Assist doesn't seem to see it. (Note that this is not the same problem with getting autocomplete to make suggestions that I have seen others post about.)
For example, if Eclipse picks up on an error like passing an invalid argument to a function, when I then go and fix the error Eclipse continues to complain about it. It continues to show me the old line before I made the change. If I open that same file with Emacs or gedit, I see that in fact the change was made and saved.
Here is what I have tried without success:
Right click on the project > Index > Rebuild
Right click on the project > Index > Freshen All Files
Right click on the project > Index > Update with Modifies Files
Restarting Eclipse
Restarting the entire machine
Checking for software updates and installing them (plus restarting).
Any ideas?
For others who might run into this issue, I wish I had a better solution but here is what solved it:
Delete the entire build directory
Clean the project
Delete the files I had been working on and re-add them.
Right click on the project > Index > Rebuild
Restart Eclipse
I'm not sure which part actually did it since I had also previously installed updates, but things seem to be working again.

An internal error occurred during: "Updating Maven Project". Preference node "org.eclipse.wst.validation" has been removed

I'm trying to open my Maven project with Eclipse Juno, but I'm getting this error:
An internal error occurred during: "Updating Maven Project".
Preference node "org.eclipse.wst.validation" has been removed.
How is this caused and how can I solve it?
Same probleme here, there the solution I fix it
Open the .project file with your prefered text editor.
delete the node that is about "org.eclipse.wst.validation"
Close your project
Open your project
Launch Maven Update...
Should be good.
Another way to fix it, if you don't want to change your .project config
(or if you had several projects that must be fixed)
Close your workspace (or eclipse)
-move out <WorkspaceDir>\.metadata\.plugins\org.eclipse.core.resources\.projects from the workspace directory
-reopen you workspace
close it again
-move back the .projects dir (say yes to replace questions ? )
open you workspace
Launch Maven Update
Should be good
Simpler fix:
Close Project
Open Project
Project > Clean
Run Maven Update
I was using Eclipse Mars and in my case, just close and reopen my IDE did the work.
Dont know, if you still have this problem, but here is the solution worked for me:
It appears that deleting the file org.eclipse.wst.validation.prefs in
the directory .metadata/.plugins/org.eclipse.core.runtime/.settings
(default settings for workspace) or .settings in each individual
project will cause the settings for validation to be reset to their
original settings. You can then use validation without getting error
messages and try resetting the options from there. However, I'm not
sure what combination of settings would cause the problem to reappear.
However, if it does, you can repeat the process.
got this from here: https://bugs.eclipse.org/bugs/show_bug.cgi?id=355012
in my case i didnt have the mentioned file in this folder, but i had a bunch of other org.eclipse.wst.* files. deleting them all did the trick for me.
The problem is not related to the .projects folder as mentioned in another answer.
The solution is to add a file called org.eclipse.wst.validation.prefs in the .settings folder. This will restore the eclipse validation node.
The content of the file, depending on your eclipse version, might look like this:
disabled=06target
eclipse.preferences.version=1
Another Solution is too simple , deleting .project file then clean the project and maven update will success surely
I think this is one error that could be caused by multiple different sources. I just had the same error however, and just figured out why. In my situation, I just tried to force update some code by deleting a few temporary files. Turned out I accidentally deleted that file as well. I thankfully had it under source control, so I pulled the file back and updated the project with Maven. I also made sure any other errors were fixed so that the project would clean / update successfully.
I'm not sure if this will solve your problem, but I hope it helps! Good luck!

RAD complains that projects are missing library files but they are present in .classpath

In my RAD, often times when I launch it and go to my workspace, i see some projects have a red error cross sign. And usually the message is that certain libraries are missing etc. But by going to the build path of each project, I can see that the libraries are existing in the build path.
This issue I have been solving by removing the library that RAD is complaining about,building the project, adding the library back and building the project again.Then the error goes away. It seems that RAD somehow loses track of the libraries. The .classpath file however shows that the library exists even though RAD was complaining.
Is there a permanent fix to this issue?
This is a known RAD problem and has been reported many times.
Go to each "broken" project, right-click and select "JavaEE -> Update EAR Libraries" and the errors should go away.
Closing & reopening the project(s) in question, then cleaning & rebuilding the workspace, will also help.

eclipse indigo major bug

I have been using Eclipse forever, but only today I upgraded to Indigo.
Using Eclipse Indigo on Mac 10.6 *
Files won't update after editing them and saving them. If I add blank lines and then save, then if I start debugging, the debugger will go through the lines that were there before, but now those lines are empty and the actual lines that the debugger is executing are a couple of lines below (due to the added blank lines). Debugger executes blank lines??!! Same thing if I change the code. If the file says X=5, and I change X=6, then debug, X will still be 5 ????!!!! Am I missing some editor caching option or smth ????
Things I have tried:
1. clean all projects, rebuild all projects
2. Delete projects, re-add them
3. delete files, write them from scratch
4. all auto-build and auto-refresh options are on
5. tried to change the workspace, the bug presists
6. tried to play around with the -xms128M and -Xmx786M option in the .ini file
7. tried restarting Eclipse and restarting computer
The problem was some discrepancy between the java version of the VM and the project's "facet" version. (whatever that is).
The thing I dont get is why the project was still running if there were problems reported on the "Problems" view and no new .class file was even compiled. Why it was running an outdated .java file, when the code on the actual display was different? (thus the ghost effect).
Is there an option that allows the eclipse to run outdated .class files if no new .class file could be compiled cause of compile errors?