The Lazy Dev

Do less. Develop more.  
Filed under

tools

 

Eclipse Shortcuts I can't live without

You can set this going to Window | Preferences then General | Keys.
There, using text filter, you can for example write "rerun" and you
will find the shortcut for the first two advice here. Let's start.

F9 re-run last test
Yes, is different than F11. Without this, you have to move your hand
to pick the mouse and point to the single last run test, right click
and at this point you just lose your patience.

CTRL-F9 re-run last test debug
same as before, far less used but sometime should be needed...

ALT+CTRL+W close others editors
Sometime, often, you need to clean open editors to clean up your mind.
Being CTRL-W the standard shortcut to close "tabs" for all
applications, this sounds like a nice and intuitive shortcut.

ALT+F12 show jUnit view
I usually keep jUnit view minimized. The reason is that there is never
enough space to read the exceptions or the errors but being almost
full screen. So I keep it minimized and it opens automatically when
test runs, with a serious size. Sometimes you need to recall it. Being
F12 the shortcut to recall the Editor wherever you are, is easy to go
from jUnit to Editor and back with this two shortcuts.

ALT+J MoreUnit jump to test
Bbeing CTRl-J already set for the default and essential Eclipse
incremental search, we need a different one for this small and
essential plugin that allows us to navigate back and forward from a
class and its test case.

Default shortcuts really important to know:

ALT+SHIFT+X to run many things
ALT+SHIFT+Q to switch to different view
F12: go to Editor, from (almost) wherever you are.
CTRL+. navigate to next warning or error.
CTRL+, navigate to previous warning or error.
CTRL+SHIFT+L to show all the shortcut for the active view!

Filed under  //   eclipse   tools  

Comments [0]

Use update-alternatives to upgrade maven installation on Ubuntu.

Screenshot9

Use debian update-alternatives to easily swith from different version of the same program you have installed on your machine. Or, more frequently, just to switch to a new version in a fast and clean way.
Let's make a simple example with maven. Ubuntu repositories have an old version and I want to use the new one with the same comfort of the packaged one. Here we go.

Let's download and unzip the new maven distribution in your $HOME/software/maven2.2.1 or wherever else you like.
Now, from a terminal:

# sudo update-alternatives --config mvn

you will see what you have installed and configured and what is the actual default version (the one with the *)

to install the new version:

# sudo update-alternatives --install /usr/bin/mvn mvn /home/ildella/software/apache-maven-2.2.1/bin/mvn 1

now again:

# sudo update-alternatives --config mvn

you will see another options, choose the right number and that's it! From now on, the "mvn" command will be binded to the 2.2.1 version of the program.
Here is the screenshot of my whole terminal session.

Filed under  //   maven   tools  

Comments [0]