Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to force Eclipse to see java project as java project?

I have downloaded a 3rd party project, which consists of multiple files, including Java ones.

General structure is as follows:

<topfolder>
   pom.xml
   <subfolder1>
      pom.xml
      src
         main
            java
               <normalclasspath>
            resources
         site
            apt
               index.apt
         test
            java
               <normalclasspath>

Eclipse imports this project normally, but is unable to index its Java content. For example, I can't browse from a variable to its definition, and so on.

Also I can't set my own Build Path since it says No action available.

Of course, I can refactor folder structure myself to suite eclipse needs, but are there any automation means for this?

UPDATE

Yes, this is a Maven project and Eclipse already knows that it has Maven nature. The only option now is to disable it

enter image description here

But this is not a question. The question is how to add JAVA NATURE, so that Eclipse knows consistence of classpath and be able to navigate to class definitions and so on.

UPDATE 2

@75inchpianist's answer about facets helped partially. It was not available to select Java facet immediately, but required turning on facets at all first. Then Java facet was already there.

Now I see, that Eclipse interprets Java, but Maven interpretation is not full. Namely, no Maven dependencies interpreted (no Maven Dependencies node in Package Explorer).

The attempt to add it fails:

enter image description here

like image 478
Suzan Cioc Avatar asked Jun 24 '26 20:06

Suzan Cioc


1 Answers

Right click on the project and select "Properties"

Within "Project Facets" make sure that Java is selected!

like image 136
75inchpianist Avatar answered Jun 27 '26 10:06

75inchpianist



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!