I am new to the java world. I created a simple java (maven) project and I see the packages and everything works perfectly. However I do see a src with two empty main and test folders. Any idea why?
EDIT: Adding more information to the answer The answer below is perfect. However on tinkering a little more I found a more compelling reason why it is shown like that in eclipse.
If the folder is in "Java build path" then those folders will be shown above in the specialized view. So you can create any folder and once you add that folder to the "Java build path" the view for that folder changes. Same if you remove an existing folder from the "Java build path" then it seems to go back as a normal tree view in the bottom.
The src stands for source. The /src folder comprises of the raw non-minified code. The /src folder is used to store the file with the primary purpose of reading (and/or editing) the code. The /src folder contains all the sources, i.e. the code which is required to be manipulated before it can be used.
As the name indicates, src/main is the most important directory of a Maven project. Anything that is supposed to be part of an artifact, be it a jar or war, should be present here. Its subdirectories are: src/main/java – Java source code for the artifact.
The src directory contains all of the source material for building the project, its site and so on. It contains a subdirectory for each type: main for the main build artifact, test for the unit test code and resources, site and so on. Within artifact producing source directories (ie.
Thus, the difference between src/ and src/main/java is that src/main/java is configured as a folder, containing java classes (or source folder in Eclipse terminology), while src/ folder just contains the source folder.
Folder are not empty. Look where your App.java is: src/main/java/com/nuance/spring
Eclipse hide you content on this place because that are special folders with special view above.
If you have other folders that aren't special, for example WEB-INF then you'll see it there.
they actually aren't empty if you look at the directory out side of your editor (looks like eclipse). eclipse has created source folders for you which can be seen above. src/main/java and src/test/java.
so if you take a look at the folder in your operating systems explorer you should see files in there
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With