title: Adding a new application group in linux
body: <p>How can I, in Java or using some other programming language, add a new program group in the applications menu in both KDE and Gnome? </p>
  
  <p>I am testing with Ubuntu and Kubuntu 8. Putting a simple .menu file in ~/.config/menus/applications-merged worked in Kubuntu, but the same procedure does nothing in Ubuntu.</p>
  
  <p>The content of my file is as follows:</p>
  
  <pre><code>&lt;!DOCTYPE Menu PUBLIC "-//freedesktop//DTD Menu 1.0//EN" "http://www.freedesktop.org/standards/menu-spec/1.0/menu.dtd"&gt;
  &lt;Menu&gt;
  &lt;Menu&gt;
    &lt;Name&gt;My Program Group&lt;/Name&gt;
    &lt;Include&gt;
     &lt;Filename&gt;shortcut.desktop&lt;/Filename&gt;
    &lt;/Include&gt;
  &lt;/Menu&gt;
  &lt;/Menu&gt;
  </code></pre>
  
  <p>Note that the .desktop file is correctly placed in ~/.local/share/applications.</p>
  
  <p>Ps: The original question did not specify I wanted a solution in a programmatic way.</p>