Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Creating project with eclipse(Having questions about package and folder )
Creating project with eclipse [message #1246019] Fri, 14 February 2014 10:59 Go to next message
Eclipse UserFriend
I am using Spring Source IDE, which has eclipse inbuilt in it.

I have some questions about Package and Folder for a project

1) When I create new Java Project, src folder gets created with it. So does al code go under this src folder only ?

2) I am getting an option to create a different src folder, when I create project. Is this folder same as default "src" folder ?

3) After creating a project "Src_Tst", if I create new folder under "Src_Tst" (by right clicking on project name), it does not look same as src folder created when project is created. So whats the difference between src folder created at the time of project creation and one created later on ?

4) whats difference between package and folder under a project ? When I create package by right clicking on project name, package is created under src folder only. So does it mean that I can nit create package under project ? Does it have to go under src folder only ?

5) When I import some code from SVN repository, how do I modify this code ? Do I create new project and put code files under src folder OR do I put code files directly under project "Src_tst" by deleting src folder and then modify files ?

6) If I put files directly under project name and delete src folder (which is created by default), will files compile by itself ?

Please answer all questions as these are creating issues in understanding.

Thanks

[Updated on: Fri, 14 February 2014 11:00] by Moderator

Re: Beginner with eclipse [message #1246819 is a reply to message #1246019] Sat, 15 February 2014 08:36 Go to previous messageGo to next message
Eclipse UserFriend
Comments below.

On 14/02/2014 4:59 PM, jignesh soni wrote:
> I am using Spring Source IDE, which has eclipse inbuilt in it.
>
> I have some questions about Package and Folder for a project
>
> 1) When I create new Java Project, src folder gets created with it. So
> does al code go under this src folder only ?
Things like *.java and perhaps *.properties or other resources generally
go there.
>
> 2) I am getting an option to create a different src folder, when I
> create project. Is this folder same as default "src" folder ?
You can have multiple src folders or just one.
>
> 3) After creating a project "Src_Tst", if I create new folder under
> "Src_Tst" (by right clicking on project name), it does not look same
> as src folder created when project is created. So whats the difference
> between src folder created at the time of project creation and one
> created later on ?
You can use File -> New->Source Folder to create a folder that's
automatically configured as a folder containing src. You can also
configure source folder using the project's Properties and the Java
Build Path wizard.
>
> 4) whats difference between package and folder under a project ?
A package is a folder in folder that's known to be a Java source folder.
> When I create package by right clicking on project name, package is
> created under src folder only. So does it mean that I can nit create
> package under project ?
Only in source folders.
> Does it have to go under src folder only ?
If you want JDT to know the folder contains Java source, it must be in a
source folder.
>
> 5) When I import some code from SVN repository, how do I modify this
> code ? Do I create new project and put code files under src folder OR
> do I put code files directly under project "Src_tst" by deleting src
> folder and then modify files ?
You can configure where to look for source using the Properties of the
project as I mentioned above.
> 6) If I put files directly under project name and delete src folder
> (which is created by default), will files compile by itself ?
You'll have to configure the Project to know you've done that.
>
> Please answer all questions as these are creating issues in
> understanding.
Did you look at any of the documentation.
>
> Thanks
Re: Creating project with eclipse [message #1248904 is a reply to message #1246019] Mon, 17 February 2014 14:35 Go to previous messageGo to next message
Eclipse UserFriend
Quote:
You can use File -> New->Source Folder to create a folder that's
automatically configured as a folder containing src. You can also
configure source folder using the project's Properties and the Java
Build Path wizard.
When I use File -> New , I don't get the option of "Source Folder". I get option of "Folder". If I create a folder with File -> New, its not same as src folder created by default when project is created. "jig_src" is created from java build path (its same as src folder created by default when project is created) , while "created_with_New" folder is created using File -> New.
Whats the difference between "jig_src" and "created_with_New" ? Does src folder get set in java path and classpath automatically ?
Quote:
A package is a folder in folder that's known to be a Java source folder.
whats the design of a Java Source Folder ? Does it automatically get set in classpath ? What are the advantages of Jaca Source Folder over a regular folder ?

Thanks




Re: Creating project with eclipse [message #1249353 is a reply to message #1248904] Tue, 18 February 2014 01:45 Go to previous messageGo to next message
Eclipse UserFriend
Comments below.

On 17/02/2014 8:35 PM, jignesh soni wrote:
> Quote:
>> You can use File -> New->Source Folder to create a folder that's
>> automatically configured as a folder containing src. You can also
>> configure source folder using the project's Properties and the Java
>> Build Path wizard.
> When I use File -> New , I don't get the option of "Source Folder". I
> get option of "Folder".
Are things like Package, Class, Interface and so on, i.e., options to
create Java elements, in the list?
> If I create a folder with File -> New, its not same as src folder
> created by default when project is created.
No.
> "jig_src" is created from java build path (its same as src folder
> created by default when project is created) , while "created_with_New"
> folder is created using File -> New.
> Whats the difference between "jig_src" and "created_with_New" ?
Whether it's configured as a source folder in the build path.
> Does src folder get set in java path and classpath automatically ?
Only when you use new Source Folder.
> Quote:
>> A package is a folder in folder that's known to be a Java source folder.
> whats the design of a Java Source Folder ?
A folder for containing Java sources.
> Does it automatically get set in classpath ?
Yes creating a new Source Folder does that automatically. Creating just
a Folder does not.
> What are the advantages of Jaca Source Folder over a regular folder ?
Java looks there for source files and they'll be incrementally compiled
automatically.
>
> Thanks
>
>
>
>
>
Re: Creating project with eclipse [message #1250378 is a reply to message #1249353] Wed, 19 February 2014 02:16 Go to previous message
Eclipse UserFriend
thanks for replies. I am getting what you are saying now. Still I need clarity on following
Quote:
Are things like Package, Class, Interface and so on, i.e., options to
create Java elements, in the list?
Yes, that's what I meant.
If a folder created with "File -> New" can not be used for keeping source code in there, then what can it be used for ?

Thanks

[Updated on: Wed, 19 February 2014 02:17] by Moderator

Previous Topic:Tomcat can be started using startup.bat but not from eclipse
Next Topic:jdbc connection problem
Goto Forum:
  


Current Time: Sun Apr 20 09:34:21 EDT 2025

Powered by FUDForum. Page generated in 0.04538 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top