making a folder visible in eclipse project - eclipse

I am trying to load tomcat 7 into eclipse using this tutorial.
When I unzipped to the folder associated with the project, the tomcat folder was loaded as a subfolder. I therefore dragged all the folders into the root folder of the new tomcat7 eclipse project. The only folder which eclipse would not move is the bin folder. Eclipse instead gives me a dialog box with the following error message: "The element 'bin' exists in the selected destination. You can either skip the conflicting element, skip all conflicting elements, or cancel the whole operation."
The problem is that there is no bin folder present. Eclipse does not show a bin folder in the tomcat7 project within eclipse. And the windows explorer view of the file system also does not show any folder named bin within the tomcat7 folder in the directory hierarchy associated with the workspace.
I feel that I need the contents of the bin folder in the place where eclipse can see and work with them. Can anyone show me how to move the contents of the bin folder into the place where eclipse will see them? Now, the bin folder is stuck as a subfolder within the tomcat subfolder within the tomcat7 project.

As your default Java Output Folder for the project, it's hidden in the Package Explorer since everything that goes there was either compiled from or copied from a visible Source Folder. Use the Navigator View when working at this low a level instead.

Related

Eclipse project shows an unnecessary project folder that cannot be removed

I have a Java project in Eclipse IDE for Enterprise Java Developers 2018-12 (4.10.0) built with Maven.
For some reason the folder src/test shows in Project Explorer as a "project folder" (by that I mean a Eclipse project folder, not a file system folder), besides being shown in the project as a source folder as well. That seems unnecessary and anomalous. For example, the same does not happen with src/main, which appears as a source folder only:
If I try to delete the project folder src/test, Eclipse warns me that it contains source folders which will be deleted along with it. I actually tried it anyway once: made a copy of the files, deleted the src/test project folder, and then replaced the files in the disk, but when I do that, the project folder just pops back.
Why is this happening and how can I clean it up?
src with its subfolder test is shown for reasons
There are regular and source folders. For faster access source folders are displayed compacted on the first level instead of in the regular folder tree. In your case, there are five source folders src/main/java, src/main/resources, src/test/java, src/test/resources and - probably by mistake (see below) - src/main which are not shown in the regular folder tree, but on the first level.
In contrast, src and its subfolder test are regular folders and therefore are shown (even if they are empty except for the source folders) in the regular folder tree. They are shown so they can be selected and the right-click menu can be shown containing commands (which might be contributed by additional installed plug-ins) related to selected folders only. Selecting all source folders contained in src is not the same as selecting the src folder, for instance when doing a file search on the selected folders, a .gitignore file in the src folder would otherwise be missed.
src/main should not be a source folder
To have src/main and its subfolder src/main/java as source folders do not make sense since they are nested. In your case, it is a Maven project so you can right-click the project folder and choose Maven > Update Projects... to derive the source vs. regular folders settings from the pom.xml file and overwrite the settings made manually. These settings are stored in the .classpath file. In Maven projects the .classpath file can be derived from the pom.xml file and therefore it is recommende not be shared or versioned.

How to set the user.home directory used by Eclipse?

When Eclipse starts, it generates folders such as the workspace and the .eclipse folder which is found in the user folder in Windows environments.
While the location of the first one is easy to set (Eclipse asks you about the workspace location), I've got a lot of troubles setting the location I want for the .eclipse folder.
In fact, the problem comes from the fact that I have 2 different hard drives : C:/ and D:/.
I would like Eclipse to create his .eclipse folder in C:/Users/username. Instead, it creates it in D:/Users/username.
I don't find any way to force the location of the .eclipse folder. Adding "osgi.configuration.area=C:/Users/username\" in the eclipse.ini proved relevant partially : the eclipse configuration part of the .eclipse folder is located where I want, but other folders found in the .eclipse aren't moved, therefore Eclipse still creates a .eclipse in D:/.
I simply would like to find a correct line of code to put in the eclipse.ini (for example) in order to have Eclipse creating the files he automatically creates in C:/Users/username instead of D:/Users/username.

Property file not available in bin folder while building in Eclipse

I have a Project that I have built on Eclipse. I have a property file added in the src directory. The java class file is available in bin, but the property file is not available. Where am I going wrong?
Assuming the type of project is Java Project
Right click on the project and select properties option. Check in the Java build path all files under source folder are included or not and also check if some files are excluded.
In my case property file is being copied to bin folder. See the picture below.
Hierarchy of source folder and bin folder are same in my case.
If project is of type plugin project
Open the Manifest.mf file in Plugin Manifest editor and go to Build tab. Check the property file is selected here if NOT then select the file and check.
Edit:
Troubleshooting steps:
Simply Restart eclipse and completely clean and build the workspace and check.

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.

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.