49

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.

informatik01
  • 16,038
  • 10
  • 74
  • 104
Leahcim
  • 40,649
  • 59
  • 195
  • 334

13 Answers13

118

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/

informatik01
  • 16,038
  • 10
  • 74
  • 104
Cleanshooter
  • 2,314
  • 4
  • 19
  • 29
76

Project->Properties->Builders then disable 'Javascript Validator

http://blindcoder.wordpress.com/2011/03/04/javascript-validator-problem-in-eclipse/

Carlos Cardenas
  • 806
  • 7
  • 5
  • This will not work if you have any open projects in the workspace as Eclipse attempts to build the project/s prior to saving the setting, which then triggers the validation issue. Best thing to do is turn off JS validation when the workspace is new or use the answer below. – Half_Duplex Jan 02 '14 at 20:05
  • 3
    This is quite funny... someone edited it (I can't tell who) so that it matches my answer. HILARIOUS! – Cleanshooter Jan 08 '14 at 19:45
9

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

Paul Beusterien
  • 27,542
  • 6
  • 83
  • 139
  • 2
    I've changed workspaces and re-created the project which was causing the errors. – Felipe Jul 17 '11 at 01:09
  • Interestingly I started getting the error after I disabled it from eclipse preferences. I will suggest if disabling javascript validation better do it at both levels i.e. project and workspace – Acewin Nov 02 '16 at 16:49
5

I am using the Spring Source Tool Suit IDE and i have fixed this issue by following the below steps :

  1. select the Project and choose the properties option.

  2. Select JavaScript > Include Path option and then choose the Source tab.

  3. Click on Edit button and Click Add button.

  4. 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.

Community
  • 1
  • 1
user3358982
  • 51
  • 1
  • 1
3

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

Max
  • 31
  • 1
3

For those of you who are having trouble with 'dynamic web projects', you may find that none of the other answers work.

I tried all the options stated here and found that disabling the 'Faceted Project Validation Builder' solved the problem..

right click project --> Builders --> uncheck the 'Faceted Project Validation Builder'

Simon MᶜKenzie
  • 8,344
  • 13
  • 50
  • 77
1

I ran into the same problem and the above suggestions would not resolved it completely unless until I came across to this post @ How do I remove javascript validation from my eclipse project?

But even then after doing all (as given the other post url), had to manually removed the "Problems" tab statements like 'Errors' and 'warning' then only it goes away completely at least in Eclipse Juno.

Hope it helps someone.

Community
  • 1
  • 1
Mohammad Arif
  • 6,987
  • 4
  • 40
  • 42
1

This is a problem that has happened to me on some Web Dynamic projects. Every time the project is built, I get this error:

Errors occurred during the build.
Errors running builder ‘JavaScript Validator’ on project ‘some-project’.
java.lang.NullPointerException

At a first sight it seems that a Javascript validator is throwing a NullPointerException, so probably you will try to disable Client-side Javascript validation from Project->Properties->Validation… but I tell you that the problem is not there, you must go to

Project->Properties->Builders

then disable Javascript Validator.

Problem solved.

Sujith PS
  • 4,776
  • 3
  • 34
  • 61
1

Project->Properties->Builders then disable 'Javascript Validator, this fixed my problem: Errors occurred during the build. Errors running builder 'JavaScript Validator' on project 'xxx'. 29

Duan
  • 11
  • 2
0

This is a problem that has happened to me on some Web Dynamic projects. Every time the project is built, I get this error:

“Errors occurred during the build. Errors running builder ‘JavaScript Validator’ on project ‘some-project’. java.lang.NullPointerException”

At a first sight it seems that a Javascript validator is throwing a NullPointerException, so probably you will try to disable ‘Client-side Javascript’ validation from Project->Properties->Validation… but I tell you that the problem is not there,

you must go to Project->Properties->Builders then disable ‘Javascript Validator’.

Problem solved. Indeed is not a real problem, but the message is a bit annoying because it happens in every build

Yashpal Singla
  • 1,924
  • 4
  • 21
  • 38
0

in my case, right clicking on project -> "Project->Properties->Builders then disable 'Validation" worked for me.

IAM
  • 41
  • 2
0

I had the same error. It happened after adding the D3 js libraries.

My solution to get rid of it:
-I moved the libraries to a server and the html page gets them from there.
-Removed the libraries from the project as they weren't needed there.

Problem solved for me.

Recommandation:
- remove the latest added libraries from your project and see if the error message disappears.
- get the libraries dynamically (in the html) from a server but do not have them in your project.

It doesn't solve the root of the problem but it does help to get rid of immediate frustrations.

Good luck.

Ronald Poell
  • 181
  • 2
  • 4
0

Disabling ‘Javascript Validator’ is not the ideal solution. It is just hiding the problem.

What worked for me is this:

Switch to a new or a different workspace from File >Switch Workspace and then import your existing project into this new workspace.

Problem solved.

bhaskarc
  • 9,269
  • 10
  • 65
  • 86