open the .project file and add java nature and builders.
and in .classpath, reference the java libs:
<classpathentry kind="con" path="org.eclipse.jdt.launching.jre_container"/>
- right click on project
- configure -> 'convert to faceted form'
- you will get a popup, select 'java' in 'project facet' column.
- press apply and ok.
depending on the eclipse in question the required wtp packages may be found with different names. for example in eclipse luna i found it easiest to search with "tools" and choose one that mentioned tools for java ee development. that added the project facet functionality. searching with "wtp" wasn't of much help.
another possible way is to delete the project from eclipse (but don't delete the project contents from disk!) and then use the new java project wizard to create a project in-place. that wizard will detect the java code and set up build paths automatically.
you can do it directly from eclipse using the navigator view (window -> show view -> navigator). in the navigator view select the project and open it so that you can see the file
.project. right click -> open. you will get a xml editor view. edit the content of the node
natures and insert a new child
org.eclipse.jdt.core.javanature as content. save.
now create a file
.classpath, it will open in the xml editor. add a node named
classpath, add a child named
classpathentry with the attributes
kind with content
con and another one named
path and content
much easier: copy the files
.classpath from an existing java project and edit the node
result name to the name of this project. maybe you have to refresh the project (f5).
you'll get the same result as with the solution of chris marasti-georg.
joe's approach is actually the most effective means that i have found for doing this conversation. to elaborate a little bit more on it, you should right click on the project in the package explorer in eclipse and then select to delete it without removing directory or its contents. next, you select to create a java project (file -> new -> java project) and in the contents part of the new java project dialog box, select 'create project from existing source'.
the advantage this approach is that source folders will be properly identified. i found that mucking around with the .project file can lead to the entire directory being considered a source folder which is not what you want.
in newer versions of eclipse (i'm using 4.9.0) there is another, possibly easier, methods. as well as project facets, there are now project natures. here the process is simple get the project natures property page up, and then click the add... button. this will come up with possible natures included java nature and eclipse faceted project properties. just add the java nature and ignore the various warning messages and your done.
this method might be better as you don't have to convert to faceted form first. furthermore java was not offered in the add facet menu.
using project project facets we can configure characteristics and requirements for projects.
to find project facets on eclipse:
i deleted the project without removing content. i then created a new java project from an existing resource. pointing at my svn checkout root folder. this worked for me. although, chris' way would have been much quicker. that's good to note for future. thanks!
in recent versions of eclipse the fix is slightly different...
- right click and select project properties
- select project facets
- if necessary, click "convert to faceted form"
- select "java" facet
- click ok
manually changing xml and/or settings is very dangerous in eclipse unless you know exactly what you're doing. in the other case you might end up finding your complete project is screwed. taking a backup is very recommended!
how to do it just using eclipse?
- select project.
- open the project properties through project -> properties.
- go to "targetted runtimes" and add the proper runtime. click apply.
- go to "project facets" and select the java facet which has appeared due to step 4. click apply
- set your build path.
- if it's a maven project, you might want to select the project, click maven -> update project configuration...
that did it for me. and eclipse is configured correctly. hope it'll work for you too.
- How to change an Eclipse default project into a Java project
- What causes imported Maven project in Eclipse to use Java 1.5 instead of Java 1.6 by default and how can I ensure it doesn't?
- How do I check out an SVN project into Eclipse as a Java project?
- How do I import a pre-existing Java project into Eclipse and get up and running?
- How to import a java project missing .project .settings .classpath files into eclipse
- How to change java version and web version on org.eclipse.wst.common.project.facet.core.xml under .settings dir of eclipse project
- How to deploy an Eclipse java project into a jar file
- How to make a Java project the default in Eclipse
- How to export java project from eclipse into a jar file with images
- How to convert a java project into .exe file in eclipse
- How can we change default label provider of eclipse ide's project explorer view to render file with customized label
- How export an Eclipse project including IBM classes for Java libraries into an executable JAR
- eclipse java how to had sqlite-jdbc-(VERSION).jar into my project and use it
- How to Change Java project into a gwt web application in eclipse?
- How to package dependencies into java project with eclipse
- How to import existing Java Project into Dynamic Web Project in Eclipse
- How to change font size in Eclipse for Java text editors?
- How to change the Eclipse default workspace?
- How to format all Java files in an Eclipse project at one time?
- How do I change the default author and committer in the Eclipse Git plugin?
- How to make an existing directory into an eclipse project
- How to change JDK version for an Eclipse project
- How to simultaneously run all JUnit tests for a Eclipse Java project without Maven?
- How do you import an Eclipse project into Android Studio now?
- How do I add a resources folder to my Java project in Eclipse
- How Do I Automatically Generate A .jar File In An Eclipse Java Project
- How to create the pom.xml for a Java project with Eclipse
- How to get your Netbeans project into Eclipse
- How to import a GIT non-Eclipse Java project into Eclipse?
- How to change default JRE for all Eclipse workspaces?
More Query from same tag
- How do I create a FieldDeclaration given an IField (Eclipe plugin)
- Properties of new tags using composite component are not displayed by Eclipse auto complete shortcurt
- Is there a way to capture the value by using the id of a tagName, when the id is dynamic
- How to Daisy Chain Eclipse Run Configurations
- Building an example project with Tycho issues an error
- Getting warning message when trying to create a runnable jar file using eclipse
- Eclipse PDE build with source code
- Space is Worspace name is causing java.net.URISyntaxException
- Ivy Eclipse Plugin Error
- Unable to deploy servlet using ojdbc in Webserver 7 from Eclipse
- Shutting down remotely debugged tomcat started from eclipse
- How to check out multiple maven projects from remote git repository
- Subclipse: Could not generate DH keypair
- Why is Eclipse resolving org.apache.log4j.Level as java.util.logging.Level?
- The import com.wordnik cannot be resolved
- look for specific sql requests in java project using regex
- java rest service through forbidden 403 error
- Using jar file in another project
- GNU ARM - nano.specs not found
- Extracting ICS Android Calendar as Stand Alone App
- Add a custom file to Eclipse/Mule Studio for any NewProjects automatically
- How do I connect a Layout/view to a specific object in a getView() adapter method?
- How to find orphan plugins in eclipse RCPs?
- how to run python in eclipse with both py2 and py3?
- Mapview not showing map when run from Eclipse. How to sign the app?
- Copy type arguments of org.eclipse.jdt.core.dom.ParameterizedType
- Error while trying to open scene builder from eclipse, mac
- Jetty 9.x eclipse plugin
- Maven 3 Eclipse Kepler is it necessary to have the environment variable to work for embedded Maven?
- Java 8 - The method map is not applicable for the arguments (<noType>)