views:

841

answers:

2

I have created several .java files. All of them are located in one directory. I used a text editor to write these files. Now I want to switch to Eclipse. How can I do it? I have tried many ways. None of them works.

ADDED:

I think the common way is to have source in the eclipse folder called "workspace". So, how do I get my files in these directory. Should I use eclipse to create a new project from existing source and Eclipse will put all file to the workspace? Or I should manually copy all my files to the workspace? Where should I put my class files than? Should I create a subdirectory? With which name?

ADDED 2:

When I try to create a project with name "game", the eclipse writes me that a project with such name already exist. But how can I open this project?

ADDED 3:

In my "workspace" I have created a subdirectory called "game". I copied all my .java file into this subdirectory. Then with Eclipse I created a new project with the name game. As a result, Eclipse created .classpath and .project files in the directory "game". It also created bin and src subdirectories. And now I think it is not the correct way to go. The source files are supposed to be in the "src" directory. Right? And at the moment all my .java files are in the "workspace\game".

ADDED 4:

I did it other way around. With Eclipse I have created a new project with the name "game". As the result, Eclipse created a folder called "game" into folder "workspace". In "game" the folder I found "src" folder. I copied all my .java files into this folder. But now in the "Package Explorer" I cannot open "src" folder. So, how can I access my source files from Eclipse? Why Eclipse does not want to open the "src" folder?

A: 

I suspect that nothing appeared in your workspace because you didn't open the files yet. Open the files from the project directory, and they will appear.

It's just a suspicion, though.

manuel
A: 

In the package explorer and the navigation screen you should now see the project you created. Note that eclipse will not copy your files, it will just allow you to use the existing source and edit it from eclipse.

Thirler
In the "Project" drop down menu "Open project" is not activated. I think it's because I have no projects at the moment. In the "Navigate" drop down menu I see no options related with projects. I see there "Go to", "Open type", "Open Type in Hierarchy" and so on.
Roman
Normally you should have a docked window on the left that shows the projects in your workspace. If this isn't there you can go to the menu: window -> show view -> package explorer.
Thirler