4

I have downloaded a JAVA FILE and I don't know how to import it in Eclipse.

1
  • 2
    Copy and paste to your project's src folder. Commented Jan 11, 2011 at 12:55

3 Answers 3

9

If it's a plain Java file (.java), just put it somewhere inside the src folder of your project. Also, you will have to change its package name, so if it says:

package com.some.package;

And you copy it to src/com/your/app, then you have to change the package name to this:

package com.your.app;

By the way, there's no "Import Java file" option in Eclipse, don't waste time looking for an automatic way to do it.

Sign up to request clarification or add additional context in comments.

Comments

2

The best way is take the file and drop it to the default workspace eclipse folder. Then open the eclipse and refresh the project

Comments

1

If you want to create a new project out of it then follow:

New -> Java Project -> Create Project from existing source.

Give correct path and proceed further.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.