tags:

views:

306

answers:

7
  • How to run the last explicitly started Run Configuration? Eclipse always tries to run the file in the current editor which is annoying when this is a class that happens to have a main method or is some non Java file for which Eclipse then tries to set up a ant task instead of just running my program. I know I can click the top most item in the Run Pulldown but I would really prefer to have a keyboard shortcut that does excatly this for me.

  • Is it possible to quickly write and run a little script to automate some tedious editing tasks? I know I could write extensions in Java but often I just want to a automate something that I will only need once and that wouldn't be longer than maybe 3 lines of javascript code.

  • Can I disbale/enable extensions without having multiple eclipse installs? Some extensions (i.e. Android) eat up a lot of resources and slow everything down a bit when they are installed even for projects where they are not used. Is there a way to lazy initialize such extensions or to load them explicitly or even better associate the loading of extentions to projects? I presume uninstalling them will make me lose all my preferences for them as well?

I'm using Eclipse 3.5 Galileo.

+3  A: 

you can use f11 for run/debug last

and for more shorcuts u can refer this http://www.allapplabs.com/eclipse/eclipse_shortcuts.htm

GK
My first question was actually referring to F11/Ctrl-F11 which are the commands that run the current file, not the last run configuration. I.e. pressing F11 in a *.js file will just pop up a dialog to debug some ant task.
x4u
did you find any from the link i sent. did you try f9?
GK
+4  A: 

This seems to resolve some of your issues nicely:

http://eclipseone.wordpress.com/

Specifically, this addresses the "run last" problem you described.

About disabling plugins, you should be able to set up multiple Eclipse workspaces with different plug in profiles. To enable/disable plugins, go to Preferences > General > Startup and Shutdown and uncheck any plug in you don't need.

In Windows, you can even create individual Eclipse shortcut icons for each workspace by specifying the workspace location using the -data command line parameter:

eclipse.exe -data <workspace path>
Jack Leow
A: 

1.Window->Preferences->Run/Debug->Launching
2.You could try to bind it as an external tool and give it some of the eclipse workspace variables as arguments.

josefx
+1  A: 
  1. To run the last launched application, the default key combo is Ctrl+F11. You can see/modify/create keyboard shortcuts by going to Preferences > Keys.

  2. Sadly, Eclipse does not have full built-in macro support. The closest substitute is code templates, which are configurable and will put down boilerplate code for you. If you go to Preferences and search for template, you'll get a flavor of what's available there.

    If you google for Eclipse macro, you'll see there are some proof-of-concept plugins out there, but nothing fully fleshed out it seems. If you're feeling very adventurous, you could write a plugin to do what you want, but I'm guessing this is not what you had in mind.

  3. Versions of Eclipse prior to 3.5 did allow you to disable plugins without uninstalling them. Strangely, I can't find that option in 3.5. I wonder if it was removed for some reason.

Rob H
+3  A: 

Go to Preferences (Menu Window - Prefereces) Run/Debug - Launching; There at Launch Operation choose Always launch the previolsly launched application.

True Soft
+2  A: 

Run Configurations

Usually eclipse uses the last used run configuration if you click on the 'Run' action (toolbar) or press ALT+R - T - 1. Using the context menu will start something based on the actual selection (which may be a java class).

Scripting

You can script refactorings. Choose Refactor>Create Script. Never used it, so I don't know if it fits your actual needs.

Disable/Enable

Eclipse, because it is based on OSGi, will only start those bundles that are really needed. So when you start an eclipse session and do not need any android classes, then the android IDE plugins will not start and will not use ressources (assuming that they're implemented correctly...). But you need to make sure, that your android projects are closed, otherwise the builder will start and trigger class loading ;)

Eclipse has introduced a new feature (new... I think since 3.4, maybe even 3.3) where you can share plugins between different installations. So you could install 2 versions of eclipse which both use the same basic plugins and only one has the additional android plugins. I#m not sure, but I think this comes as a feature of the p2 provisioning support.

Andreas_D
+1  A: 

These are the shortcuts I use most often:

  Shift + Strg + O : Organize imports

  Shift + Alt + R  : Delete current element.

  Ctrl + D         : Delete current/marked line.

  Ctrl + Space     : Content assist.

  Ctrl + 1         : Context-sensitive proposals.

  Ctrl + 7         : (Un)comment current/marked line.

  Ctrl + M         : Max./minimize current tab.

  Ctrl + J         : Incrementel search.

  F3               : Jump to the declaration of the current element.

* Define own shortcuts

  - Window/Preferences/General/Keys

  Alt + C          : SVN Commit.

  Alt + U          : SVN Update.

  Shift + Ctrl + N : "New Class" Dialog.

* Templates

  - Window/Preferences/Java/Editor/Templates

  syso + Ctrl + Space : System.out.println();

  main + Ctrl + Space : public static void main(String[] args) {

                        }
Helper Method