How to use wmctrl to activate window of a given class?

Solution 1:

Since <WIN> is a parameter of the -a option you should run the command as:

wmctrl -x -a gvim.Gvim