I have three different projects in my eclipse and yesterday src file became unvisible in one of the projects. Two days ago it was ok and I have no idea how this happened. I can not see src file in project explorer or package explorer.
Project Explorer :
However, if I look with navigator I can see all files in the directories.
Navigator :
I use Eclipse Indigo SR2 and IBM Rational ClearCase for first two project. The other is my local test project.
Do anybody know how can I get back to src file into the project explorer?
Thanks.
Try to right-click on the project and click on refresh.
I had the same problem today, it is because i switch to wrong view model.I suggest you to switch the project explorer to Package Explorer.
Check your Java build path to make sure the src is present. Right click the project and select Build Path -> Configure Build Path. If the src directory is not present in the build path, it will not show up under the Java area as you have shown, but it will be present in the Navigator.
I had the same problem in Neon - src folder had disappeared. One sub-directory in the src folder would show up but no other sub-dir and not the parent src file itself. No matter what I did in the buildpath configuration only the one sub-dir would show up. It looked like some kind of corruption in the settings. None of the above solutions worked for me, including deleting the project and all files, and then re-checking it out.
What did work was switching to an old workspace, importing a project and then switching back to the workspace with the issue. Magically, the project with the problem was again responding to my changes in the buildpath configuration. I'm not sure if I had to do the interim step of importing fromt he old workspace or not - possibly just switching back and forth would have worked but not sure.
Try removing (deleting) the project without removing the files (there is a checkbox that allows you to keep the project files).
Then re-import the project. Not sure if this will solve your problem, but I was facing the same issue and delete->re-import resolved it for me.
I had this problem today, and the issue was that the "src" folder was not correct in the "Source" tab of "Configure Build Path" window. It was there but the path was wrong, so it had a red X. Deleting that entry and re-adding the "src" path (from the project) resulted in putting the "src" folder back into the packages hierarchy.
In my case, this happened because of sharing the workspace between user accounts, the paths to the workspace and the folder beneath were not the same. One user accessed the workspaces locally, the other as a mapped drive, etc.
Fixing this and then standardizing the path to be identical for all who access sit, resolved the underlying problem that caused this issue to surface.
Restart your eclipse work space.
Also change open perspective in eclipse.
Related
My friend sent me a project from his eclipse workspace for me to take a look at, however when I tried to put the folder in my workspace it did nothing. I opened eclipse and nothing was there. So i tried to make my own project and just put the .java and .class files in their respected folders, but it still didn't work. Is there some special way I have to transfer them? I should also mention he has a windows computer and I have a mac if that makes any difference for file types like that. Thanks for the help!
If you can just take the .java files and paste them into your 'src' folder in a new eclipse project, you should have no issues. Just make sure you refresh your project in eclipse(right-click on project folder and click refresh, or click on it and hit f5).
This is what i normally do.
Suppose your eclipse workspace is D:\EclipseWorkspace and your project name is Project1.
Then i would copy Project1 in eclipse workspace on disk to have D:\EclipseWorkspace\Project1.
Then create a new java project in eclipse and when prompted for name provide name as Project1 (exactly same) and say finish. It will import the project automatically. Everything should be up :)
I had running project opened in eclipse. After an accidental restart of windows, now when I open the eclipse I see my project is marked with a little red cross. Now when I run the main method I get a java.lang.NoClassDefFoundError.
I have tried restarting eclipse, Project -> Clean but it doesn't solve the problem.
When I checked the project directory, inside 'target' folder there are no compiled .class files. I tried building the project but I can't get the compiled class files, which is the reason for the error.
How do I solve this?
I tried all the solutions here, but here's what worked for me.
First, remove the project from eclipse.
Then, in your project folder, delete the 2 files that eclipse creates. They're hidden, but they're called .project and .classpath.
Finally, add the project back into eclipse and eclipse will recreate those 2 files and a new configuration for your project.
My specific issue was that it a project that was missing a Java Builder because it thought it was a scala project. The only way for me to reset this was by removing the project, deleting the 2 files, and adding it back in.
Maybe Eclipse's workspace files have become corrupted. Restart Eclipse and choose a new workspace folder (or choose Switch workspace from the menu). Then import the project files into a new project.
Try deleting the run configuration and remaking.
If that doesn't work, open the class, ctrl+f11 to run. That will force Eclipse to update its classpaths & rebuild its main indexes.
To delete the configuration:
- Menu -> Run -> Run Configurations.
- Select your configuration
- Press delete or use the delete icon
If you are using maven, this will likely fix it: Right click your project -> Maven -> Update project.. (or alt + F5), select your project, make sure "Refresh workspace resources from local filesystem" is checked and click ok.
My eclipse project has similar issue though the error appeared slightly different. I imported a third party java project into Eclipse, with Project > Build Automatically checked, do a Project > Clean..., no classes were generated in the output bin folder. Tried different options, no luck.
I noticed a red exclamation mark at the top left corner of the project name.
Right click on project name, Properties > Java Build path, I saw "Build path entry is missing: cci/src". Manually created src folder, the red exclamation mark gone. Do a Project > clean..., project compilation successful
P.S. The eclipse project is not properly organized, there are no code under src folder. I suspected src folder went missing while checked in by original author since there are no code there.
Was having the same problem and finally found the glorious hint here.
In my project there is one *.scala File and Eclipse Neon is incompatible with the Scala IDE, thus there is no builder for scala and the whole project is not built.
After removing the Scala file and the Scala Package from the linked Libraries )Project Properties --> Build Path --> Libraries) and afterward re-adding the Java Builder (no idea why this one went missing, but here's a useful help on how to add the Java builder when missing), the project could be built and run again.
Try refreshing and then cleaning the project.
For me the problem is in missing jars,the jars were added first and the location of those jars where changed after.
So When I correctly added all the required jars again to the build path, it starts to build project correctly.
I copied an Eclipse project from my PC (eclipse is on drive D) to the laptop (eclipse is on drive c) but when I try to deploy the agents I have in my project I keep getting the following error:
The archive **D**:/eclipse/plugins/it.fbk.sra.ejade_0.9.0/lib/libjade4/commons-codec-1.3.jar which is referenced by the classpath does not exist.
I changed all the libraries' addresses to the correct ones (C:/eclipse/plugins/it.fbk.sra.ejade_0.9.0/lib/libjade4/__etc__) for all of them by right clicking the project > build path > configure build path... but that doesn't work. I also tried to refresh the project, restart eclipse but still nothing..
Any suggestions?
Thanks a lot!
First make sure that the .jar file is exist in the given path,if so then you can easily try making a new project and copy your material to it, and configure it to the .jar path.
If this doesn't work you may need to remove the temporary files from your project and eclipse on your laptop.
Also, please give more description about what happens on right clicking the project > build path > configure build path ?
Hope everything works well.
I had the same problem and just discovered the solution to this.
Go to project>properties>Java Build Path>Libraries>Add External JARS.
After specifying JAR file at a certain location, you will see it in previous window "JARs and class folders on the build path:" with "JAR_fileName - C:\YOURPATH".
Don't stop here instead click on the "+" button to the left to expand it, and IF it says "Source attachment: (NONE)", you double click it and add the path to the JAR file by selecting Workspace location.
This solved the problem for me.
Had the same problem and non of the above solutions worked.
This is how I fixed it.
go to your project folder
open .classpath file (enable view hidden files if its not showing)
edit the path
delete the project from workspace. Imp: Don't select (Delete project
content) checkbox when prompted. !!!
re-import the same project
I had the same issue...
I was refering jars from a mapped drive, when I moved them to my local drives, it started working fine. Also try giving a shorte path for the jars.
In eclipse I have an error related to my build path.
The error:
Project 'XX' is missing required library: 'middlegen-2.1.jar'
But the library is deleted before the build path configuration.
Is there perhaps a problem with cache or so?
Has anyone an idea why eclipse say that the library is required even though the library was deleted before the build path configuration.
With Best
I guess you've deleted the library from a directory, but you've not updated the project Build Path. Right click on the project name, select "Properties", go to "Java Build Path", choose the "Libraries" tab, and see that your library is not in the list. If it's still in that list, remove it with the "Remove" button.
This error is due to probably either missing required library or due to caching of eclipse
Solution 1
Open project explorer window.
Right click on the project and goto Buildpath -> ConfigureBuildPath
Under the libraries tab check whether all the used jar files are physically located in the directory/web application library.If something is showing "RED X" mark then fix them by either putting the jar in the place or remove it or add it newly using add JARs
Solution 2
1.Try cleaning the project's using Menu->Project->clean (select the projects and clean it)
Solution 3
If your build path is very clear i.e no Red "x" marks then the error could be of eclipse caching.Then do below step
1.Right click on the project choose "close project".
2.Once the project is closed again right click on the project select open project
This solution will clear the eclipse cache.
Hope any of the solution should resolve your problem.
I had this same problem, but the steps above didn't help. I did a search through files in the Eclipse workspace and found files named .markers and .markers.snap that contained the bad path names under the folders in .projects that were named for the projects that weren't building. I exited Eclipse, backed up those files, removed them from the Eclipse workspace, and restarted Eclipse. The problem went away.
Your project configuration includes a reference to middlegen-2.1.jar on the build path. That file is missing. You can either a) put the file there, b) change the configuration to point to the file in another location, or c) remove the reference, cross your fingers, and hope the project compiles and runs without the jar.
I don't know what "the library was deleted soon" means, so if that is important to your question, you might want to rephrase.
I noticed that "sometimes" the resources i put into a source folder in my Eclipse project will not be copied to the output folder ("bin") immediately.
E.g. i change a properties file using the eclipse editor and save... and "bin" still has the old version.
Does anyone know what exactly triggers the copying (and how i can trigger that from a plugin)?
I thought it happened automatically when a resource changes.
-- EDIT --
To clarify what i meant by triggering it from a plugin: I have a plugin that depends on up to date resources in the output folder, but apparently the resources are outdated when my plugin is called. And that's why i need to better understand what happens and how i can force it when i need to.
If you don't add the resource through eclipse (but for instance through the windows explorer), eclipse wont notice some changes until you refresh your project/folder. (right click in the packater explorer for instance).
After it notices the change it will copy it to the output folder when you build (often this is done automatically upon changes)
This is a Bug in almost all Eclipse versions, it happens without any reason. My eclipse 3.5.2 and 3.6.2 both meet this problem in someday. In my case, I need to copy modified .clj clojure source files to classes directory for immediate effection in a web app, now I have to set /src before /classes in CLASSPATH of web appserver startup script, It's solve my problem temporarily.
As #Thirler said, if you don't add the resource through Eclipse, it may not notice the files until you refresh your project. However, if the Refresh/Clean doesn't work (in my case, it didn't), you have to add the files to the folder structure IN ECLIPSE.
Just drag the file from the folder where it is in the file system using Finder/Windows Explorer, drop it into the same folder in Eclipse's Project Explorer (Eclipse will ask for overwriting, just say yes) and Voila!
EDIT:
An easier way is to just navigate into the folder using Project Explorer and then Refresh (F5).
As far as I know it happens when you build the project. You don't need a plug-in, you just need to tell eclipse to do a build of the project.
There is an Eclipse setting Java > Compiler > Building > Output folder > Filtered resources.
For unknown reasons, this was set to *.launch,*.testsuite,*.deploy,*.location,*.execution,*.datapool,*.artifact,*.html,*.svg in my workspace (while the default seems to be just *.launch). This was the reason, why my Eclipse constantly refused to copy a classpath resource index.html.
Late response, but I just stumbled over this question but non of the answers helped me to convince Eclipse to do its job.
This happened to me when I imported an Eclipse project as a whole, including both src and bin directories. The fix is to Clean the project: Project -> Clean... -> select your project and press Clean. This should re-build the project and properly locate the resources needed.