I am trying to create one folder under src/test/resources but i am not getting proper folder
getting like below screen shot
but i need like below image
There is no difference between the two folders , it dependes to eclipse perspective , but if you want show folder icon and not sources icon you can simply change the name from config to config-project like this :
Right click on the project. Select properties. Go to Java Build path.
Select source tab. There you'll get an entry for src/test/resources. Expand that node, this will show following nodes:
Double click on excluded. Add exclusion patters as I have added testInput:
In your case it'll be config. press Finish ->Ok. This will make your eclipse to treat config as non source folder.
Related
Environment
Eclipse Mars 4.5.0
I'm trying to create a package with name com.javalabs.web.action but instead of that Eclipse created a folder inside com.javalabs.web.
As you can see in the following picture, the icon is not the same that, for example actions.
The problem seems to be only with the name action, because a could do that with actions and other names.
I don't care about the package icon, but the big issue is that Eclipse doesn't recognise de classes inside that folder as their classpath.
Any idea of what can be?
Click on 'src' folder and refresh. There you go..
Check the "Resource Filters" configured for your project (you can find them as a child of the "Resources" entry in the project properties).
The next set of filters is in the "Java Build Path" where you can configure exclude patterns per source folder.
That's what I did step by step to solve the problem:
Right click on Project Folder > Properties > "Java Build Path"
Select source folder where you are creating the package
Double click on "Excluded" under the folder you want changes
Edit
Under Exclusions patterns > remove everything you need to include specially remove the **
Finish
Apply
Is there any way to limit the search for "Find all References" in Eclipse so that it ignores files in the target directory. This is not the same as the answer from this question: Limit “Find References” in Eclipse to only references from my code. That answer only works for text search. I want all references to a particular variable.
Maven Java project?
If the target folder is properly set as Default output folder in the project's properties > Java build path > Source you should be fine.
Source: just tested on Eclipse Indigo (I've tried Ctrl+Shift+G on both classes and variables); the search is limited to src/main and src/test.
Try:
Go to Window->Customize Perspective. In Command And Groups Availability tab enable Window Working Set option if not enabled. Click OK
Go to Window->Working Sets->Edit. A dialog will pop up. Click NEW button
A dialog will pop up. Select Resource option in that. Click Next Button
Click on Select All Button. Deselect the target folder. Enter the name for this working set say "Exclude target folder".
Open the source file in editor. Keep cursor on a variable. Right on that variable
Go References->Working set->Exclude target folder
By this you can also exclude some files along with folders. One drawback in this is that you have to manually deselect each and every files and folders to exclude.
Right-click and select properties and then check the derived check-box. Done.
This works for the target directory and any other directories and files you want to exclude from searches and your normal workflow since the IDE will view these derived resources as resources that are not original data, and can be recreated from their source files.
Eclipse IDE - Can someone please tell me how I can group my external .jar files into a C:\lib folder? I'd really like have them all in a lib folder and not taking up vertical space in the root of my project (see attachment).
I have read some of the similar posts here and tried them but my projects still are not 'seeing' the needed .jar files! It's very frustrating.
I know how to add a Folder but how do I tell Eclipse my .jar folders are in c:\lib so my projects will execute? I'm not even sure if making a lib folder in my project is even related to the fact that my jar files happen to be in c:\lib.
Thanks...
(source: msgVault.com)
From your description it sounds to me like you want the jars to stop taking up space in the root of your project. I am not sure how you initially added them but if I am adding external jars this is what I usually do:
Right click on your project, select properties, then Java Build Path, and then click the libraries tab, click on add external jars and then you can select each one individually (which would be a pain) or you can select them all at once if they are in the same folder (hence the c:/lib). Click OK and it should add them into a Referenced Libraries folder like so:
Also, when you open the libraries tab initially, if all of your jars show there, remove them before proceeding as you don't want to import them twice into your application (If that's even posssible, not sure).
Edit
Switch to Package explorer:
Click on Window > Show View > Package Explorer
Update
If you want to add c:\lib to your project do this:
Right click on your project, highlight build path, click Add Libraries..., in the list select User Library, click Next, click User Libraries... on the right. A new window will open. Click New... and then give the library a name such as "clibs". Click OK and then highlight the new library and click add external jars. Select the jars you want from c:/lib and then click OK. Now you can add that User library to any application you want and it will not "pile" up in the root directory under Project View.
That is just eclipse's way of displaying what libraries are on the build path of the project. It doesn't mean that they are on the root of the project, those are just references to those jars ( that maybe any-where on the system ).
A good practice is to get all the jars required by your project and put them in a folder. Next, you can either declare that folder as a library from eclipse and add that library on your build-path or you can just add the jars directly. But they will still be displayed like you are seeing them already. The true path of where these jars are located will be written next to them (like you can see in the attachment C:\selenium....).
I am looking at the below location
/media/public_/workspaces/workspacemy/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/
there is nothing even after clean build.
Only after cleaning Tomcat a class comes.
I wonder if Eclipse build my classes and try to put some wrong place?
If so where can i configure that place.
Thanks.
Right click on the project name, click on properties. Select build path (in left pane), and then go to sources folder tab. At the bottom you can specify the default target location or you can specify target location for each source folder separately by clicking on each source folder.
When you have a Java project in Eclipse, how do you change the location where the class files are placed? The bin directory is the default location.
You can change the folder name from bin to something else.
Right click on your project and select Properties.
And then click on Java Build Path.
On the right side you can see the tabs Source, Projects, Libraries,...
Click on Source. Check the Default output folder:. There you can browse and select the different folder you want.
But you cannot change the directory. For example if your project is in D: drive you cannot keep the output folder in C: drive.
Right click on your project and select Properties.
Java Build Path --> select the Source tab
See the below image for more details:
Right-click on our project --> select properties --> select Java Build Path --> select the Source tab. At the bottom of the tab you should see a field named (Default Output Folder:).
I would like to describe an approach below.
First, create a new empty project locally in eclipse work space for storing generated output files say output_bin.
As mentioned in above steps, now from Default Output Folder we need a new Variable to link to our project output folder.
Default Output Folder -> Browse -> Create New Folder...
-> Advance -> check "Link to folder in the file system" ->
Variables -> New.. -> Name = PROJECT_OUT, Location = "CHOOSE_PATH_TO\output_bin\bin\Project1bin" -> Ok
Note: Project1bin is a new directory which stores the bin folder. output_bin is an empty project and you can have multiple bin folder for various projects.
These answers only describe changing for one specific project.
But if you are using a build tool in Eclipse such as Gradle, you are likely to get annoyed by spurious build errors caused by class files being produced under \bin... the best thing is therefore to change the default output folder:
(Eclipse Mars)
Window --> Preferences --> Java --> Build Path --> Output folder name: change from "bin" to "build"
NB be aware, however, that this (currently) only appears to work when you create a new Java project using the Java project wizard. I import Gradle (STS) projects and find that I nevertheless have to change manually from "bin" to "build" for each project.