If it is a simple Java file (.java), just put it in the src folder of your project. In addition, you will have to change the name of your package, so if it says:
package com.some.package;
And you copy it to src/com/your/app , then you need to change the package name to this:
package com.your.app;
By the way, in Eclipse there is no option "Import Java file", do not waste time looking for an automatic way to do this.
source share