Eclipse Java EE jQuery Validation Error Workaround
During my recent Java EE project I came across an annoying bug which always showed an Error Symbol on my root project folder. At first I thought it was a Java error but then I saw it was caused by the minified version of jQuery. This is an Eclipse bug already reported in summer 2011. I guess this can also happen with other minified JavaScript files.
Workaround – How to fix
To get rid of the annoying Error symbol do the following:
- Right click your Project root folder in your Eclipse Project Explorer View
- Go to Properties -> JavaScript -> Include Path -> Source Tab
- Select Excluded and Edit… and then Add..
- Now you can either browse for JavaScript file which has errors or just enter a wildcard pattern which will exclude anything matched by your pattern. In my case in entered
**/jquery*.js
to exclude all jQuery library files. - Then you can hit OK, Finish and OK again
- Your Eclipse Progress View should now show a Building Workspace message
- Tada! The Error Symbol is gone!
Background information
So what did Eclipse do for us?
It added a file named .jsdtscope to the .settings folder. This might be faster for console lovers among us.
Content of the .jsdtscope file:
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry excluding="**/jquery*.js" kind="src" path=""/>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
<classpathentry kind="output" path=""/>
</classpath>
Written by Hendrik Will
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ee
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#