RAD complains that projects are missing library files but they are present in .classpath - 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.

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 workspace projects suddenly have bad build path

I generated several Java projects last spring. Today I opened Eclipse back up and selected the workspace I used in the spring but now all the projects have a red X on them. They all list the same problem:
**The project was not built since its build path is incomplete. Cannot find the class file for java.lang.Object. Fix the build path then try building this project.**
The build path looks ok (I think). I tried to create a new project as an experiment to see it there are differences. The new project dialog box has **Use default JRE (Currently jre7)** checked and a warning at the bottom:
**The current workspace uses a 1.4 JRE with compiler compliance level 1.7. This is not recommendes and either the JRE or the compiler level should be changed.**
Not sure what changed since last spring but something obviously has. I don't really understand what it is trying to tell me. ?Anybody have any ideas I would greatly appreciate it. Thanks.
Update: I created a new project and compared its buildpath to one of the projects from last spring. In the new project, it has: **JRE System Library [JRE7]**
In the old project that now has the problem I see: **JRE System Library [JAVASE-1.7](unbound)**.
Somehow I think the "unbound" means something bad. Still do not understand how it was ok last spring and now suddenly it isn't.
The "unbound" means that there is no JRE at the path specified in the classpath. My guess is that, since last spring, modifications were made to your java installation(s).
To bind your project back on a JRE, click on your "unbound" JRE and click on the "Edit..." button. In the Edit Library window, select a working JRE (JRE 7 would probably be a good choice in your case), then click on Finish. The "Unbound" message should disappear and your classpath should be okay afterwards.

Eclipse CDT shows errors before project is built

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.

The project cannot be built until the build path errors are resolved.

While compiling an android project in eclipse 3.4.2, I am getting The project cannot be built until the build path errors are resolved.
I got a temporary solution from the blog http://www.scottdstrader.com/blog/ether_archives/000921.html
The resolution was to force a resave of the selected projects (and their .classpath files):
Open the project properties
Select Java Build Path > Libraries
Add a new, arbitrary library (to be deleted later) > OK
Wait for the workspace to refresh (or force a refresh of the project)
The error(s) will go away
Remove the dummy library
The only other references I could find were to make minor alterations of contents of the .classpath file.
Is there any permanent fix for this issue?
Have you tried using Project > Clean... from the menu? This will force a new build on the selected projects in Eclipse.
1-Right CLick on your project folder, Choose Build Path > Configure Build Path
2-Select Libraries Tab and delete any arbitrary library present there.
3-Click on Add Library option, Select JRE System Library and click Next.
4-Choose last Radiobutton option Workspace default JRE and click Finish.
5-press f5 for refresh.
6-run ur program .
This what fixed it for me...
I was having an issue with my spring-core.jar.
I deleted the entire release directory located here. (I'm on win 10).
C:\Users********.m2\repository\org\springframework\spring-core\4.3.1.RELEASE
I right clicked on the project > Maven > Update project and my exclamation mark disappeared. No problems any more.
Here is the source where I found the information:
http://crunchify.com/cannot-be-read-or-is-not-a-valid-zip-file-how-to-fix-maven-build-path-error-with-corrupted-jar-file/
This happens when libraries added to the project doesn't have the correct path.
Right click on your project (from package explorer)
Got build path -> configure build path
Select the libraries tab
Fix the path error (give the correct path) by editing jars or classes at fault
This works for me: close the project then re-open it, this will force eclipse to reload a fresh project and detects the correct build path.
None of the other answers worked for me. Even after fixing my build path issues, doing a refresh, clean, rebuild, and restart (of both eclipse and the computer), I was still getting the little red exclamation point.
I fixed it by closing the project (right-click, close project) and reopening it (double-click the closed project), which seemed to force eclipse to "notice" that the build path problems had been corrected.
For my mac osx Eclipse, I followed following steps:
Right CLick on your project, Choose Build Path > Configure Build Path
Select Libraries Tab and delete any arbitrary library or anything else causing errors in Build Path.
Click on Add Library button, Select JRE System Library and click Next.
Choose last Radiobutton option Workspace default JRE and click Finish.
Clean and build your project.
get a cmd and run
mvn eclipse:eclipse
This is what worked for me:
Go to ~/.m2/repository and deleted everything there by running rm
-rf. Make sure everything is deleted.
Re-launch eclipse or STS
Right click on project -> Maven -> update project.
On my Mac this is what worked for me
Project > Clean (errors and warnings will remain or increase after this)
Close Eclipse
Reopen Eclipse (errors show momentarily and then disappear, warnings remain)
You are good to go and can now run your project
I've seen this problem a few times (got it again right now on my home computer with Eclipse 4.2).
Forcing a resave (by changing the classpath e.g. by adding a library, save, change-back) works temporarily. But the problem comes back when Eclipse is restarted :(
Nuking the Eclipse workspace from orbit will permanently fix it (until next time). But there must be a better way!
just check if any unnecessary Jars are added in your library or not. if yes, then simply remove that jars from your library and clean your project once. Its worked for me.
In Eclipse this worked for me: right click project. -> Properties -> Library Section; Add (any library at all) -> select library and click remove -> press okay.
I ran into this annoying issue with the Play framework. It would be nice if there was some way of knowing what build errors Eclipse is unhappy about, but it's not going to tell you. With one project, I was able to close the project, rebuild the Eclipse configuration with sbt eclipse, and reopen. With an almost identical project, that didn't work. But deleting the project, rebuilding the Eclipse configuration with sbt eclipse, and importing, did the trick.
If you think you've done everything correctly but Eclipse still complains about the jars, refresh the folder where the jars are and make sure eclipse knows they've been added to the project. Specifying the file path alone is (apparently) not enough
I've faced this issue a couple of times and following the below steps has resolved both the times.
1. Navigate to C:\Users\
2. locate the ".m2" folder and delete it.
Now navigate to the particular project in eclipse and Right-click on the project > Maven > Update Project
wait until the project is updated and in my case following the above steps resolved both the times.
I was getting an additional warning
The compiler compliance specified is 1.6 but a JRE 1.8 is used
Resolving this warning make the error also go away. The steps are as follows:
I right-clicked on it, then clicked on Quick Fix. From the dialog that opened I selected Open the Compiler Compliance property page, and clicked the Finish button.
(This is same as Java Compiler section.)
In this dialog I found the Compiler compliance level drop down and changed 1.6 to 1.8, and clicked on Apply and close.
I got a message box Compiler Settings Changed which asked if I wanted to Build the project now?. I clicked on Yes.
The build path error went away.
Go to > Right CLick on your project folder > Build Path > Configure Build Path > Libraries Tab > remove project and external dependencies > apply & close
Now, Gradle refresh your project.
Added below to pom.xml file and it worked eventually:
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>4.0.0</version>
<scope>provided</scope>
</dependency>
Goto to Project=>Build Automatically . Make sure it is ticked

Eclipse hangs while opening workspace after upgrading to GWT 2.0/Google app engine 1.2.8

After upgrading to the newest GWT/Google app engine I have problems opening my workspace in Eclipse. On startup, Eclipse hangs almost immediately and needs to be closed. This happens only in the workspace where I use GWT with app engine, and I weren't able to consistently reproduce it - sometimes it starts normally, and sometimes I need to kill the proces and restart it. There is nothing in Eclipse error log. Eclipse version is Galileo, running on Windows 7 RC.
Anyone else had similar problems? I googled but Google is not my friend today.
EDIT: Still happens after upgrading to GWT 2.0.1.
I got frustrated with not being able to open my workspace today, and finally solved this by importing projects into a new clean workspace.
Create new workspace and open it in Eclipse (to create .metadata folder).
Close Eclipse.
Manually copy all settings from old workspace (the most important settings are stored in the .metadata/.plugins/org.eclipse.core.runtime/.settings directory). Alternatively, you could use File / Export / General / Preferences in Eclipse, and then File / Import them, but I wasn't able to open workspace to do that.
Open the new workspace.
File / Import / General / Existing projects into workspace. Select root folder of your old workspace, and take care to check "Copy project into workspace".
Restart Eclipse and check that everything in the new workspace is working as it should.
Delete your old workspace.
EDIT: Another, and a bit better workaround which apparently works:
Close Eclipse.
Temporary move offending project somewhere out of the workspace.
Start Eclipse, wait for workspace to load (it should).
Close Eclipse again.
Move the project back to workspace.
I used "eclipse -refresh". Apparently it hangs on refresh something, the lower right corner tells you, what it's doing. For me it was refreshing the gwt runtime in a specific project, maybe trying to find an update or something. If you don't want to reimport your whole workspace, try -refresh or move this project temporarily out of the way.
I just deleted the state.dat file in the GWT project metadata, which seemed to remove the blocking and then triggered a recompilation.
<workspace>/.metadata/.plugins/org.eclipse.core.resources/.projects/<GWT project>/org.eclipse.jdt.core/state.dat
This probably won't serve as a general solution, but it worked for me and it's a lot quicker than having to copy whole projects. Maybe another file will have the same effect. I think the trick is just to "damage" the GWT project metadata enough to have it rebuilt.