Profile photo
Submitted by Martin Fowler
on July 28th, 2011 at 16:25:50 EST

How can I use jQuery in Eclipse

I am planning to work on some UI tasks that we have selected jQuery to do it.
How can I use jQuery in eclispe?

Profile photo
Replied by SBajra
on July 28th, 2011 at 17:17:29 EST
I am not expert in Eclipse but I think JQuery is client side Javascript library. So, it should not be independent in any IDE like Eclipse or Visual studio. Just reference the JQuery library and then start using the library.
For more information visit JQuery documentation:
Accepted Answer

Profile photo
Replied by Martin Fowler
on July 28th, 2011 at 18:30:41 EST
Thanks for the response.That's true I was searching for some plugin but just to import the library and use it and later change when we get updated version will be better idea.

Profile photo
Replied by Hige Gojira
on August 11th, 2011 at 12:00:23 EST
There's no PDT package for latest Eclipse 3.7 Indigo and downloading it whole through Eclipse "Install New Software" can be very frustrating with sd unstable connection as mine,
I've prepared clean install for Windows 64-bit suitable for PHP/JavaScript/jQuery development including the following:

Eclipse 3.7 WebJS Win 64-bit
PDT 3.0
Eclipse Color Theme 0.11.1
JSDT jQuery - lightweight plugin to add jQuery support (tiny alternative to heavy plugins Aptana and jQueryWTP)

To enable jQuery code assist (auto completition) right click "JavaScript Resources" in your project (for PHP project you had to enable JavaScript support) and in "Libraries" tab click "Add JavaScript Library". jQuery library should appear among choices. Choose it, confirm everything and you're done. :)



Profile photo
Replied by Martin Fowler
on August 11th, 2011 at 15:17:00 EST
@Hige thanks for your response and direction.Appreciate it.
As as work around I have done this.

Help->Install new software->All Available Sites->Web, XML, Java EE and OSGi Enterprise Development

I do have java script editor after doing this steps.
I can do

File->New->JavaScript->Java Script Source file to bring new js file with javascript editor capability

Please note that I am using Eclipse 3.7 @64 bit.Let's share each other idea.Life is learning and sharing knowledge everyday.Please let me know if you don't follow any of these steps I can build a article with screen shots like they have it here:

Profile photo
Replied by Martin Fowler
on August 11th, 2011 at 15:26:41 EST
I did that for java script editor. I will try yours for jQuery editor and get back to you in case I have any issues.
Thanks again.

Profile photo
Replied by Cara Reed
on August 11th, 2011 at 15:30:38 EST
That works great thanks @Hige.

Profile photo
Replied by Amira Rashed
on December 10th, 2012 at 11:10:47 EST
I want to use eclipse in developing phonegap and JQuery application so i create a phonegap project using phonegap wizard and i included JQuery built in library ver. 1.1 AND when i reapet the process for the phonegap project with JQuery mobile ver. 1.2 i got the same error : the library is already defined .
Can you please help with that error ?

Profile photo
Replied by Martin Fowler
on December 10th, 2012 at 13:04:47 EST
Can you please put some debug stmt to make sure if it goes in these if else
if(!!window.jQuery) {
// jQuery is loaded
} else {
// load jQuery first

//For eg:
if(!window.jQuery) {
var script = document.createElement('script');
script.src = '';;
script.type = 'text/javascript';

Profile photo
Replied by Zed Ulisse
on May 22nd, 2013 at 06:14:55 EST
Here comes a question.

If it's linked to project explorer, How to use in Remote System Explorer?
I don't use projects. Everything is working fine, html, perl, javascript, but i cannot get this plugin jquery to work.

Any Solution?


Profile photo
Replied by Yogaraj Khanal
on May 23rd, 2013 at 06:50:08 EST
Search for JSDT jQuery from eclipse market place after doing update in eclipse.
Then you select that plugin and install. It's very easy process.I just did recently and works fine like jQuery auto completion and other stuff like Java for suggestions on available events and selectors.

Profile photo
Replied by Yogaraj Khanal
on May 23rd, 2013 at 06:53:36 EST

Profile photo
Replied by Stas Ustimenko
on November 11th, 2013 at 13:20:30 EST
I suggest to try Codelobster PHP Edition -
It has great support for JQuery and many PHP frameworks.