JavaScript / HTML highlighting / debugging in Eclipse using PhoneGap

Go To StackoverFlow.com

9

I am writing an app using PhoneGap for Android in Eclipse. Since the project is an Android project, it's in a Java perspective. For whatever reason, Eclipse won't highlight HTML and JavaScript for me while in an Android/Java project/perspective and switching to the JavaScript perspective doesn't highlight the code either. Without highlighting or debugging tools, the debug process is very slow.

How do I tell Eclipse to highlight HTML and JavaScript for me while working in a Java Environment?

2012-04-04 20:14
by Jason Hartley


13

Make sure you have JSDT(for JavaScript) and the Web Page Editor(for HTML) installed. From About Eclipse -> Installation Details, check for JavaScript Development Tools(JSDT) and Web Page Editor.

To install them :

  • Install New Software -> Work with: Indigo (or Helios) ->Web, XML Java EE, and OSGi Enterprise Development -> JavaScript Development Tools
  • Install New Software -> Work with: Indigo (or Helios) ->Web, XML Java EE, and OSGi Enterprise Development -> Web Page Editor

Alternatively, you could use the AppLaud Eclipse plugin I've created for doing PhoneGap development for Android. See the Getting Started instructions.

2012-04-04 23:25
by Paul Beusterien
After installing, make sure to right click a file in the explorer and choose Open with: to select your newly installed editor. Don't do what I did, which was continue to open them in the default text editor view and then complain that the newly installed perspectives were not working - shanethehat 2013-01-04 11:47
This should have been the accepted answer in my opinion, as this is a solution instead of a workaroun - Maarten 2013-01-26 13:44
In light of shanethehat's addition, I presume that this will solve the problem and is the best answer. When I tried Paul's solution, I did not get the results I expected, but I suspect that if I had done what shanethehat describes it would have worked. Even though I haven't tested it, I have made this the accepted answer because as Maarten pointed out, it's a solution rather than a bullshit (but effective) workaround, as seen in my own (previously accepted) answer - Jason Hartley 2013-04-09 15:42


4

The only real solution I found was to create a new html document and paste in the text from the original document, delete the original, then rename the new document. This technique is dumb, but it works.

2012-04-06 22:58
by Jason Hartley
Weird, but it works, thanks! BTW, have you submitted a bug report - Vitaly 2012-05-03 17:55


0

Aptana is the best plugin for HTML and Javascript editing in Eclipse.

2012-04-05 00:40
by Yang


0

This Eclipse plugin is useful: http://www.aptana.com/products/studio2

Simon Mac Donald http://hi.im/simonmacdonald

2012-04-07 13:26
by RAJ
Ads