eclipse workspace where to keep misc files - eclipse

This may seem like a strange question but can I add a folder in the eclipse workspace that doesn't get recognized by the system? Someplace to keep my notes and java files I'm not ready to including in the build yet?
I tried putting a directory my under src but ecplise tried to compile the files in there, I just want a place where I can keep stuff I don't want eclipse to look at
Thanks

Try excluding a folder/files by:
Right-click a project folder in Project Explorer tree and then go to
"Properties".
click on Resource and then go to "Resource Filters".
Add exclusion filters for files/folders .

Related

I need Netbeans help. NO project's -src node appears so no source files--only -Libraries node shows

I hope it's OK to ask this here. Netbeans forums isn't responding. If not, I'll delete this or ask for it to be deleted. I'm desperate so I'll face the wrath, if any.
I moved my Netbeans projects folder from one directory node to another to make backing up all my stuff easier. BAD MOVE.
Now when I open a project using Files | Open project (ctrl-shift-O) NO source files appear because there is no "+Source Packages" node to expand.
It looks like this for all projects, e.g. one named GBL:
Projects
-GBL
+Libraries
It doesn't look like this anymore:
Projects
-GBL
+Source Packages (How do I get this back?)
+Libraries
The Netbeans Properties for each project shows me the path it's using. Windows 7 Explorer shows me that the src, build, and nbproject folders contain files and ALL the source files are in the src folder for that path.
What have I done and more importantly what should I do to get back to being able to open a project normally?
(I've tried recreating the original Netbeans folder and using Windows Explorer to copy an entire project folder into it but: same result--all I see is the Libraries node under the project's name node.)
I just tried to Clean (and also Build) to see what would happen. Error:
ant -f C:\\Users\\Dov\\Documents\\NetBeansProjects\\BasicShirt -Dnb.internal.action.name=build jar
C:\Users\Dov\Documents\NetBeansProjects\BasicShirt\nbproject\build-impl.xml:[u]231[/u]:
Must set src.dir
I just Set Configuration by right-clicking the project's name and provided a path to the src folder.
NOW I SEE MY SOURCE FILES BUT NOW THIS line in the .xml file is flagged with similar message:
<fail unless="[u][b]test[/b][/u].src.dir">Must set test.src.dir</fail>
NOW what do I do? (Netbeans 7.4.)
If I could get rid of the 7.4 automatic creation of +Test Packages, I might be OK.
If you can help, I'd be very happy.
(I'm considering re-installing 7.3 if available or removing and reinstalling 7.4 and try to avoid the "testing" requirement, but there goes all my many tweaks of 7.4.)
Well, after considerable frustration with the problem, I solved it, essentially.
It's here, in total. My synopsis plus how it helped me follows. In short, I had to set up a new java project based on existing sources using the New Project Wiz and simply direct Netbeans to the sources.
File > New Project
Choose Java Project with Existing Sources.
Type a (new) project name and ...
... make the Project Folder contains the path to where you want the new project to be stored. (For me, this is the folder where Netbeans has been able to find my sources.)
Click Next for the Existing Sources page of the wizard and ...
5a. ... in the Source Packages Folder pane, click Add Folder and ...
5b. ... navigate to your sources and select the source root folder.
Clicking Next goes to the Includes/Excludes pane, which I didn't need to use.

Delete source folder in PyDev project generates error "Source folder not found"

When deleting a source folder in a PyDev project in the Project Explorer, the project PYTHONPATH is not updated and there is a red x marking in the outline with an error message saying "Source folder: [source folder name] not found".
Is this really the intended behavior? I would expect the PYTHONPATH to be updated if source folders are removed.
I'm using PyDev version 2.7.3 and Eclipse 3.7.2.
Steps to repeat the problem:
In Project Explorer, create a new PyDev project with File -> New -> PyDev Project
Create a new PyDev source folder by right-clicking the new project and selecting New -> Source Folder (under the PyDev menu)
Remove the source folder (which was just added) by right-clicking the source folder and select Delete.
Add a new source folder (needed to trigger the error).
There is a red x error mark and a message saying "Source folder: [source folder name] not found".
Go to PyDev Properties. The deleted folder is still listed in the Source Folders tab under PyDev-PYTHONPATH.
Note: When repeating the steps above in the Package Explorer instead of the Project Explorer, the red x's don't show up - so you can't see there is a problem. However, if you look in PyDev properties the behavior is the same - PYTHONPATH is not updated.
Right click on your project folder->Properties->PyDev - PYTHONPATH. Select the directories causing the errors and click Remove on the right.
Looks like the problem happens when project name doesn't match directory name.
e.g.,
env/VersionModifier/src/myfile.py
.project file = CoolTool
source folder not found
env/VersionModifier/src/myfile.py
.project file = VersionModifier
OK
You could call it a bug or an "enforcement of best practice" but right clicking on the project and making its name match its enclosing directory fixed the problem for me in Kepler.
Good luck
Peter
the way i resolved it is to go to the folder in which your code is stored and find a file by the name of .pydevproject. It is an invisible file in eclipse/aptana so you may have to do this through cli or file browser. look for a structure that look like <path>path/to/your/file</path> and delete the ones that show errors in your package explorer. this will resolve your problems for now, but this is a bug and needs to be reported.
I think the problem stems from the fact that pydev fails to remove the <path>...</path> vars once the user deletes the source folder.
Below is how I resolved this, hope it helps.
Clean Up:
Removed the project from eclipse; of course, leaving it as on disk.
From the source directory removed ".project" and ".pydevproject" files.
Recreate:
Created a new PyDev project (in eclipse), providing the existing source directory. In the New Project dialog, selected "Create 'src' folder and add it to the PYTHONPATH".
The project got created properly, without any source-folder errors.
Now add the folder you want to add as source directory, by right-clicking the folder and selecting the option under "PyDev".
At the end, you may just delete the "src" directory that was created by eclipse.

Eclipse: How to add an existing source folder?

I have a directory called c:\RemoteSrc . Under this there are 3 directories which are currently source folders (I think? the icon is an open folder with a little orange grid in it) in my Eclipse project. I have dropped a new directory under c:\RemoteSrc which I also want to add to my project.
BUT
If I right click on my project and go "Build Path..." -> "Link Source" and try to add it it tells me "Folder already exists with a different case". Yes i KNOW that the folder already exists THATS WHY IM TRYING TO ADD IT.
I think all you need to do is refresh the project. Eclipse does not automatically pick up folders (or files) dropped into it's project directory.
A screen capture might help, but if the GUI is un-cooperative, you can:
close Eclipse
open the .classpath file which defines your project (it may be located in your workspace)
see if you can define a new classpathentry of kind "src": this is not the easy method, but that may give you an idea why the GUI refuses to define the same entry.
For Linked Sources, you should have something like the following in your .classpath
<classpathentry kind="src" path="module_name"/>
With a corresponding matching entry (within <linkedResources>)in your .project
<link>
<name>module_name</name>
<type>2</type>
<location>path/to/your/module</location>
</link>
NOTE: Removing a linked project doesn't necessarily remove it from the project.
No need to close Eclipse.
Open .project file using Notepad++, find link to the existing source/folder and delete it. Save the file.
Refresh the project in Eclipse.
Now you should be able to link it again.
I had a problem where I had created a /src directory in my working directory and then wanted to link another directory with additional files to import. The "existing directory" turned out to be because the directory I was trying to link was also called "/src", even though the path was different. I guess Eclipse can't have two /src directories in the same project, similar to trying to mount two file systems at the same node. I rearranged the directories so there was only one /src, and all was well.
There were conflicts when I tried to update my project which resulted in creation of multiple .classpath files.. SO removing the copies and reverting the latest .classpath file and then refreshing/rebuilding project ,solved the issue for me.
Hope it helps!
Sometimes the simple refresh (Greg Adamski's answer) does not work, e.g. because the source folder is not in the src-directory (in my case, I had to reference Swagger auto-generated code which was located deep in the target/.... directory after a Maven Build).
In this case, right click the project, open the 'Build Path' -->'Configure Build Path' dialogue, select the 'Source' tab and select your additional source folder via the 'Add Folder' button.

Help me understand Eclipse's Java Build Path

I have been moving my Java projects from Jdeveloper over to Eclipse whenever I have to go back and make a change (I only work with Java projects sparingly).
Everytime I try to create a project in Eclipse (3.3.2) I spend quite some time trying to figure out the proper way to configure the source directories in the Java build path dialog.
The biggest problem I'm having is getting the source directories to match up with the package specified in the source files. For Example my project looks like this:
MyProject
DevelopmentBuilds
MainSRC
The MainSRC directory is also the "Root" package so my classes would be defined as:
package MainSRC.Sub1;
If I set my included directory to blank, the files compile but with many errors because the Packages are not in the right place.
How do I tell eclipse to start at MainSRC for the compilation rather than the children of MainSRC?
Or, should I the path up with one src folder with MainSRC as subfolder?
I basically don't understand how this works.
you need to set MainSRC as a 'Source Folder'.
Apparently, you project root are set as Source Folder.
Enter in project properties:
. Right click over your Project root, and select Properties
. Choose Java Build Path
. Remove all source folders
. Click 'Add Folder'
. Select 'MainSRC'
. Click Ok and Ok
Now, your MainSRC are a Source Folder. Some error occurs inside source files. For agile process, right click over package 'Sub1', and press F2. Rename your package for a new, then all your source files will be put in the correct new package.
[]'s,
And Past
You would need to set the source directory to the root MyProject directory. You would have to tell Eclipse to exclude the other directories (such as DevelopmentBuilds) as they are not source code.
You might find you're better off conforming to Eclipse's expectations and creating a source folder which contains your main package folder.

Eclipse - Ignore Entire Directories

I use Aptana Studio (based on Eclipse). I'm trying to get Eclipse to completely ignore an entire directory inside a project. I mean COMPLETELY. I don't want it to display in the project folder. I don't want Eclipse to even be aware it exists.
Unfortunately, all my efforts to add it as a filter don't work. See http://forums.aptana.com/viewtopic.php?f=14&t=8340#p33714 . I think the filter only prevents the folder from being displayed in the project display. It doesn't keep Eclipse from actually looking at all the files in that folder for code assist, etc.
My problem is that directory has thousands of text files. So, each time Eclipse opens or refreshes this project, it analyzes all those files.
How can I prevent this?
Not sure about this aptana thing, but there is a convenient way to do it in native eclipse:
Right-click a project folder in Project Explorer tree and go to "Properties".
Resource -> Resource Filters.
Add as much exclusion filters for files/folders as you like.
If your project tree is not refreshed immediately, press F5 to enforce it.
Consider also the 'Derived' checkbox: right-click an entry in the package explorer, choose properties, check Derived. This may solve part of your problem.
See http://robmayhew.com/eclipse-ignore-folder/
If you have a linked resource (pointing off to some other file/folder on disk) with the same name in the same location in the resource tree, then the real folder on disk will be hidden from the resource model.
Unfortunately you can't create the linked resource if the real directory is already there in the project structure. You can try something like this:
On disk, rename/move the directory in question
Refresh the project, the directory is gone
Create a linked resource ( New -> File/Folder >> Advanced -> Link to file in the file system ). Name it the same as the original directory.
On disk, restore the original name of the directory
Refresh project.
Try right-clicking "Properties" and unchecking all permissions.