Comment 39 for bug 484610

Revision history for this message
Robert Dyer (psybers) wrote :

That is the general approach. However in cases such as Java that usually fails. Most Java apps have a frontend script that calls 'java MainClass' and sets up classpath etc. So the .desktop file contains exec=somescript while when you lookup the cmdline you see 'java MainClass'. There is no way to match that directly.

This problem exists for most 'scripting' or 'managed' languages (python, perl, etc). The slight difference here is that often times with python/perl/etc the script name and the frontend launcher are named consistently enough that we get a direct match by simply ignoring the 'perl ' in front of 'perl foo.pl' and can strip off the file extension. With Java this almost never works (most Java main classes are like 'org.blah.foo.MainBar' for an app with a launcher named 'bar'. This is inconsistent enough that we cant really do simple hacks and get most of them.