Not sure if this is best for Stackoverflow or Superuser since it pretty much applies to both...
I'm running Lubuntu and I want to create a Windows-like 'start menu' search for the LXDE desktop menu. As with Windows, after an item has been found, I want to be able to launch it.
The LXDE menu system works with .desktop files, so my code performs the following command using Runtime.exec()
to start up the programs:
gtk-launch <.desktop filename without extension>
This runs great for 99% of the time. Unfortunately I cannot figure out why that other 1% refuses to launch. One of these applications is TeamViewer. Now here comes the strange part: When I run the command gtk-launch teamviewer-teamviewer10
in a terminal, it works great, but if I run the same command through Runtime.exec()
, it does not start, but it does not give me any error messages either.
Here is my code:
Process p = Runtime.getRuntime().exec(new String[] { "gtk-launch", "teamviewer-teamviewer10" });
p.waitFor();
Do I have to modify the gtk-launch
command or is there something wrong with my code? (Note: Almost all other programs launch just fine.)