I am using eclipse on my project and while messing around with my eclipse settings, I turned on Javascript support. Now eclipse complains that JQuery library has errors in it and is not letting me compile the project. Does anyone know how to turn javascript validation off?
8 Answers
I actually like MY JavaScript files to be validated, but I definitely don't want to validate and deal with trivial warnings with third party libraries.
That's why I think that turning off validation all together is too drastic. Fortunately with Eclipse, you can selectively remove some JavaScript sources from validation.
- Right-click your project.
- Navigate to: Properties → JavaScript → Include Path
- Select Source tab. (It looks identical to Java Build Path Source tab.)
- Expand JavaScript source folder.
- Highlight
Excluded
pattern. - Press the Edit button.
- Press the Add button next to
Exclusion patterns
box. - You may either type Ant-style wildcard pattern, or click
Browse
button to mention the JavaScript source by name.
The information about JavaScript source inclusion/exclusion is saved into .settings/.jsdtscope
file. Do not forget to add it to your SCM.
Here is how configuration looks with jQuery files removed from validation:

- 42,981
- 12
- 84
- 132

- 44,836
- 10
- 105
- 121
-
3This is actually the correct answer. The answer by Redlab is not sufficient, since it doesn't cancels the javascript project builder. – Yoni Dec 13 '11 at 21:14
-
2@Yoni. Don't forget the question was asked and originally answered more than a year ago. This solution may not have even been available back then. – Alexander Pogrebnyak Dec 14 '11 at 02:09
-
Doesn't change the fact that Redlab's answer doesn't actually solve the problem. You also have to do what Brad suggests below... – Jules Jan 29 '12 at 15:36
-
1I've been so long annoyed by error highlight on project that i work on because some issues in jquery ui library... and this was soo easy to fix... thanks :D – T.G Dec 16 '12 at 08:58
-
You browse to any js file that you don't want eclipse to validate, such as jquery. – Kevin Mar 11 '13 at 18:58
-
At 'edit dialog' you select file/directory with 'add multiple' instead of writing regular some pattern.. – radeklos Apr 01 '13 at 18:24
-
Caveat/Tip: After you perform the steps above you'll need to probably do a *Project->Clean* to make those dreaded red X's go away. – Adam Gent Apr 08 '13 at 12:40
-
What is meant by this at the end of the answer? "Do not forget to add it to your SCM." – cellepo Jul 30 '14 at 20:03
-
@cellepo. SCM - Source Control Managment system, as in GIT, SVN, CVS, etc. – Alexander Pogrebnyak Jul 31 '14 at 15:59
-
This is not answer to How to disable validation, this is answer to How to exclude resources from validation. @Brad Marchesseault gave the correct answer. – Jaroslav Záruba Oct 01 '14 at 09:22
-
1The excusion pattern to ignore all the javascript is `*/*.js`. Adding this in the exclusion patter worked for me. – Lucky Jul 01 '16 at 09:34
Turn off the JavaScript Validator in the "Builders" config for your project:
- Right click your project
- Select Properties -> Builders
- Uncheck the "JavaScript Validator"
Then either restart your Eclipse or/and rename the .js to something like .js_ then back again.

- 1
- 1

- 1,275
- 1
- 8
- 2
-
6no need to restart ecplise or rename any file..just build workspace and right click your project and Validate. – Lucky Dec 13 '13 at 08:53
-
1
I removed the tag in the .project .
<buildCommand>
<name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
<arguments>
</arguments>
</buildCommand>
It's worked very well for me.

- 1,686
- 1
- 27
- 37
-
1Since I have JSHint, this is the best answer for me. I removed also PyDev JS validator. Building is fast, finally. – Marco Sulla Jan 22 '16 at 19:10
-
If anyone is stuck on building project. This is the answer for you. Thank you very much @Claudionor Oliveira..... – Paulson Peter Jun 20 '17 at 10:37
-
Yeah, I was a long time with this problem and a solution was simple \o/ – calraiden Jun 21 '17 at 12:39
Window -> Preferences -> JavaScript -> Validator (also per project settings possible)
or
Window -> Preferences -> Validation (disable validations and configure their settings)

- 3,110
- 19
- 17
-
6Doesn't work since the Javascript validator is an Eclipse builder and even turning off all validation on a project will still try to validate the Javascript in your project. – Dieter Hubau Aug 11 '14 at 07:59
Go to Windows->Preferences->Validation.
There would be a list of validators with checkbox options for Manual & Build, go and individually disable the javascript validator there.
If you select the Suspend All Validators checkbox on the top it doesn't necessarily take affect.

- 10,640
- 10
- 57
- 84

- 41
- 2
-
3It doesn't seem to work, my Eclipse keeps validating JS regardless of this configuration. – Bruno Medeiros May 14 '15 at 21:48
Another reason could be that you acidentically added a Javascript nature to your project unintentionally (i just did this by accident) which enables javascript error checking.
removing this ....javascriptnature from your project fixes that.
(this is ofcourse only if you dont want eclipse to realise you have any JS)

- 12,638
- 15
- 47
- 56
In addition, if you are using Tern eclipse IDE or IBM Node.js Tools for Eclipse, you may need to disable JSHint and other libraries that you don't want.
To disable this, Project Properties > Tern > Modules > JSHint or any other library that you don't want.

- 10,158
- 3
- 55
- 67