54

I'm mostly using Eclipse for Android development these days, and have developed good muscle memory for Ctrl-F11 to run my app. Problem is, if I happen to be editing an XML file (like manifest or layout) when I hit that key combination, Eclipse does something that I find inscrutable... It attempts to "run" my XML file, creating an erroneous output file (called something like layout.out.xml) that I then have to delete, adding a useless XML launch configuration to my history, and generally being a pain in my butt.

It's no big deal, but it is an ongoing annoyance. Does anyone know how to disable "run" for XML in Eclipse? I've tried to find a config item for it, but Eclipse's options are such a rabbit hole that I haven't had any luck there myself.

Thanks!

Sterling
  • 6,365
  • 2
  • 32
  • 40
  • possible duplicate of [android sdk main.out.xml parsing error?](http://stackoverflow.com/questions/2393103/android-sdk-main-out-xml-parsing-error) – i_am_jorf May 21 '12 at 15:08

5 Answers5

72

You can tell Eclipse to launch your latest launch configuration, instead of attempting to create a launch configuration for the current document/selection. Under Preferences -> Run/Debug -> Launching, you can select "Always launch the previously launched application".

EDIT: You probably have a plugin which defines a launch shortcut which triggers on XML-files. This sounds like a pretty dumb thing to do.

grahamparks
  • 16,130
  • 5
  • 49
  • 43
JesperE
  • 63,317
  • 21
  • 138
  • 197
  • Thanks, that seems to work. FWIW, I've had trouble with incompatible Eclipse plugins in the past, so this is a clean install with only the Android SDK added. So presumably that launch shortcut is defined in the Android plugin itself. – Sterling Jan 31 '10 at 12:00
  • 5
    No that can get annoying too. Better to do what this guy said over here: http://stackoverflow.com/questions/2393103/android-sdk-main-out-xml-parsing-error/5469625#5469625 – Robert Massaioli May 05 '11 at 02:19
  • 1
    I know this is an ancient question but @RobertMassaioli 's link is definitely the way to go (in the comments), not this answer. – durron597 Aug 06 '13 at 15:26
  • I would say that it all depends on your workflow. I understand that some people may find this behavior annoying, but the major benefit from my point of view is predictability. – JesperE Aug 07 '13 at 08:47
  • If you can figure out which kind of launcher it is, you can `Filter` it out from the `Launch Configurations` preference page. – nitind Aug 27 '14 at 04:07
2

My solution is uninstall XSL plugin.

Oraple
  • 43
  • 1
  • 7
2

Thanks to JesperE's answer I solved it by "Always launch the previously launched application".

Just wanted to add that I didn't have the problem with launching xml until I install "PHP Development Tools".

My conclusion is that in the future I might consider having two separate installs of Eclipse:

  • One with clean Java and Android programming (possibly other stuff)
  • And one with PHP and possibly other web-related stuff
0

As Oraple stated:

uninstall [the] XSL plugin

This is done by

  1. clicking on Help > Installation Details
  2. searching for "xsl"
  3. select the plugin
  4. clicking on the Uninstall...-button at the bottom
  5. restarting your IDE if prompt
Impulse The Fox
  • 2,638
  • 2
  • 27
  • 52
0

As an alternative to @JesperE's solution, you can filter out the XSL run configuration by Run/Debug -> Launching -> Launch Configurations -> Filter checked launch configuration types (on right pane) and then check the XSL checkbox.

Eclipse Preferences

When you apply and close the preferences window, open "Run Configurations" and you will notice the annoying XSL launch config is no longer there. This way, you can still have the ability to launch the selected executable class, but not if it is an XML file.

Run Configuration

hfontanez
  • 5,774
  • 2
  • 25
  • 37