JavaScript validator throws NullPointerException in Eclipse
I'm coding some PHP files on Eclipse IDE, and I keep getting an error that says "Building Workspace has encountered a problem" -- Workspace is the name of my project area.
When I click on the "details" link I get this
Errors occurred during the build.
Errors running builder 'JavaScript Validator' on project 'Ullman'.
java.lang.NullPointerException
As mentioned, I'm working in PHP so I don't know why it's trying to set up JavaScript Validator. I can't figure out how to stop it from doing these things. Anyone know?
I'm not experienced, so please provide a detailed answer if you can.
Solution 1:
I just ran into this problem myself and the previous accepted answer was not helpful. The problem is not the validator, it is the build. To fix go to Project -> Properties -> Builders, then disable ‘JavaScript Validator’. Since you are working with PHP your build is getting confused when you try and validate a PHP file with a JavaScript validator.
The error message doesn't really do anything it just gets annoying really fast.
http://blindcoder.wordpress.com/2011/03/04/javascript-validator-problem-in-eclipse/
Solution 2:
Project->Properties->Builders then disable 'Javascript Validator
http://blindcoder.wordpress.com/2011/03/04/javascript-validator-problem-in-eclipse/
Solution 3:
UPDATE: Cleanshooter's answer is the better one for PHP-specific projects. I'm leaving this answer since it is useful for people who run across the error on JavaScript files because of crashes in the JavaScript parser.
You can disable part of the JavaScript validator with Eclipse -> Preferences -> JavaScript -> Validator -> Errors/Warnings and unchecking Enable JavaScript semantic validation
Solution 4:
I am using the Spring Source Tool Suit IDE and i have fixed this issue by following the below steps :
-
select the Project and choose the properties option.
-
Select JavaScript > Include Path option and then choose the Source tab.
-
Click on Edit button and Click Add button.
-
Now enter the value for Inclusion Pattern as *.js then click on Ok button and Finish.
I have solved my problem in this way. Please let me know if any one have any other way to solve this problem.
Solution 5:
Just go to Project -> Build Automatically and disable this option.. you won't need it anyway with PHP.. because there is nothing to be build.. but this solves the NPE thrown at each save or f5 action