I have a project where there are a no of applications built as separate Java projects.
These have been sent over by someone and somehow the .project
and the .classpath
files have not been copied.
So when I try to import it into eclipse it gives me an error:"No project found
".
Is there any way to generate the missing files?
Eclipse will make these files for you, but the way to make it do so is not very intuitive.
In Eclipse, make sure the project is not currently showing up in the Project Explorer or Package Explorer. If it is, right-click it and click the Delete button - and make sure the "Delete from Disk" option is unchecked before you hit "Ok"!!!
Select File / New / Java Project
Uncheck Use Default Location, then Click "Browse" and find the folder it is located in.
Click "Next" for more options, or just "Finish".
Eclipse will import the project and automatically create the default .project
and .classpath
files for you. With the one case I tried, with source in the default src/main/java folder, I could build and run fine at this point.
I've better solution for this issue, only for MAVEN users. To resolve it follow below steps.
D:\workspace\project\
.
2.Open command Line prompt and run this command : mvn eclipse:eclipseDefinitely, Your issue will gone.
First of all, the reason why you can not Import your project into Eclipse workstation is that you do not have .project
and .classpath
file.
Now that you know why this happens, so all we need to do is to create .project
and .classpath
file inside the project file. Here is how you do it:
First, create .classpath
file:
Create a new txt file and name it .classpath
.
Copy and paste following code and save it:
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Then, create .project
file:
Create a new txt file and name it .project
Copy paste following code:
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>HereIsTheProjectName</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
You have to change the name field to your project name. You can do this in line 3 by changing HereIsTheProjectName
to your own project name and then saving it.
You cannot import them as project if .project and .classpath are missing. You can create a new Java project and copy the source files into it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With