Reputation: 7066
I'm finally biting the bullet and starting use Eclipse (Europa for now) instead of command-line java and Notepad. However, I've not really organized my projects apart from naming conventions (e.g., ProjAClassname1, ProjAClassname2, ProjAClassname3, etc) and they're all in my JRE java/bin directory. I have a directory full of *.java files that I want to start organizing into a brand new install of Eclipse.
I've followed the instructions in the Eclipse help files, googled for a while and I've found some excellent Stack answers on importing JAR files, importing existing Eclipse projects. However, none of these work. None of the resulting dialogs show a list of files to import/add; I think they assume that all my classes are contained in *.jar files instead of *.java files.
I created java\bin\ProjA\src and copied all my source code *.java; same results. The closest I got was creating a new project, then dragging and dropping the *.jave files from Explorer to Eclipse. The classes all showed up as part of the project, but I had the little red x indicating "out of sync with file system", and even though I found this, none of the solutions offered in that answer worked for me.
Before I start creating new classes and cutting/pasting from Notepad, I wanted to know if there were any other ideas floating out there?
Upvotes: 4
Views: 16622
Reputation: 1
Upvotes: -1
Reputation: 1
To import your project to Eclipse that was coded in other editors such as Textpad and etc., simply open eclipse and make a new project, expand your project, and then go to your folder, take your .java
file and other packages and drag it on the source folder in eclipse. You will be prompted and choose "copy to new folders", which is the first option. And enjoy compiling and debugging in Eclipse.
Upvotes: -1
Reputation: 9232
First of all, I would recommend using a newer version of Eclipse. The current version is Kepler (4.3, whereas Europa is 3.3) which means you are about seven releases behind.
More to the point, if you have a folder with all your Java files in them, you could use File -> Import and pull in all the files from a directory into the workspace.
Upvotes: 0
Reputation: 5637
You can add your java files by simply dragging them to eclipse, then try doing this
Go to "Project" -> Clean
Then select all projects and click on Ok
Upvotes: 4