12

I am making a javaEE project. I imported a project from my computer as a maven project (Import->Import as maven project) The project has many javascript files in the source folder. Eclipse is not showing outline of my javascript files. '

However when i imported the project as a javascript project the outline was shown correctly!!

How can i make the outline correct when i import it as a maven project?

Shivendra
  • 1,542
  • 2
  • 22
  • 35
  • What package of Eclipse do you have (eg, Eclipse for Java Developers, Eclipse for Java EE Developers, etc)? Have you installed any other plug-ins or features? – E-Riz Aug 05 '14 at 13:27

3 Answers3

22

I just answered this for another question, very similar to yours.

You need to add the JavaScript "nature" to the project (basically, tell Eclipse to treat it as a JavaScript project). Right-click on the project and choose Configure > Convert to JavaScript Project....

enter image description here

After doing that you should see a Builder named "JavaScript Validator" and have the JavaScript section in the properties.

E-Riz
  • 31,431
  • 9
  • 97
  • 134
0

Check that you have .js files associated to Javascript Editor. Go to Window->Preferences-General -> Editors -> File Associations. Find the "*.js" entry, click on it, then click on Javascript Editor and click the Default button.

dimoniy
  • 5,820
  • 2
  • 24
  • 22
0

This work for me in Eclipse Photon:

  1. Close Eclipse.
  2. Edit the .project file adding the Javascript nature: org.eclipse.wst.jsdt.core.jsNature

enter image description here

Source

jsanmarb
  • 906
  • 12
  • 14