4 Replies - 8235 Views - Last Post: 09 September 2011 - 04:17 PM Rate Topic: -----

#1 shankarr  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 09-September 11

Convert Folder in Eclipse to Source Folder

Posted 09 September 2011 - 03:49 AM

hi,

I am working in eclipse indigo, so i want to convert ordinary folder to source folder..
How to convert?

This post has been edited by macosxnerd101: 09 September 2011 - 11:03 AM
Reason for edit:: Renamed title to be more descriptive

Is This A Good Question/Topic? 0
  • +

Replies To: Convert Folder in Eclipse to Source Folder

#2 macosxnerd101  Icon User is online

  • Self-Trained Economist
  • member icon




Reputation: 10469
  • View blog
  • Posts: 38,804
  • Joined: 27-December 08

Re: Convert Folder in Eclipse to Source Folder

Posted 09 September 2011 - 11:03 AM

There should already be a source folder when you create a new project. You shouldn't need to convert a folder to a source folder.
Was This Post Helpful? 0
  • +
  • -

#3 farrell2k  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 823
  • View blog
  • Posts: 2,536
  • Joined: 29-July 11

Re: Convert Folder in Eclipse to Source Folder

Posted 09 September 2011 - 12:32 PM

Create a project in Eclipse. Take the .java files from your src folder and just copy them into eclipse. You may have to change package declarations in the .java files.
Was This Post Helpful? -1
  • +
  • -

#4 GregBrannon  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 2198
  • View blog
  • Posts: 5,226
  • Joined: 10-September 10

Re: Convert Folder in Eclipse to Source Folder

Posted 09 September 2011 - 01:28 PM

To add to farrell2k's suggestion, as I think he's on the right track: If you copy the files from their original folder into the Eclipse file structure - into the workspace/project/src folder - you may not see the changes right away in Eclipse. To show what you've done in Eclipse, select your project and depress F5, or right click on your project and select "Refresh." After doing that, the files you copied into the src folder should appear. As farrell2k also suggested, if your existing source files have package declarations, Eclipse may move them into the correct src/package folders when you "Refresh" Eclipse, or you may be shown an error message that the files are not in the correct location, offering to move them for you. I forget which you'll see.

If we still haven't answered your question, please provide more details.
Was This Post Helpful? 0
  • +
  • -

#5 pbl  Icon User is offline

  • There is nothing you can't do with a JTable
  • member icon

Reputation: 8328
  • View blog
  • Posts: 31,857
  • Joined: 06-March 08

Re: Convert Folder in Eclipse to Source Folder

Posted 09 September 2011 - 04:17 PM

View Postfarrell2k, on 09 September 2011 - 03:32 PM, said:

Create a project in Eclipse. Take the .java files from your src folder and just copy them into eclipse. You may have to change package declarations in the .java files.

Won't work, they will not be recognized as being part of the project
You will have to:
- create the project as mentionned
- use Eclipse File... Import ... File System to bring (and be registered) your files into the project
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1