How do I diagnose “There was an error launching the application”?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}
I created a my-app.desktop
file for a program I wrote. When I double-click it, I get the error message "There was an error launching the application". How can I get more detailed information about what the problem is?
I saw a reference to a "details" section of the dialog box, but there is nothing like that present in the one I see. If I were on my Mac, I'd open the Console app to see if any errors were logged, but I haven't learned of anything similar on Ubuntu.
(Note that unlike other similarly-titled questions, I am not asking what's wrong with this particular .desktop file; I want to know how to find out in general.)
launcher .desktop
|
show 2 more comments
I created a my-app.desktop
file for a program I wrote. When I double-click it, I get the error message "There was an error launching the application". How can I get more detailed information about what the problem is?
I saw a reference to a "details" section of the dialog box, but there is nothing like that present in the one I see. If I were on my Mac, I'd open the Console app to see if any errors were logged, but I haven't learned of anything similar on Ubuntu.
(Note that unlike other similarly-titled questions, I am not asking what's wrong with this particular .desktop file; I want to know how to find out in general.)
launcher .desktop
1
I would just run the Exec line from the terminal and see what the output tells you, but are you sure the desktop file is ok? maybe you should check and run it from the terminal as well.
– Jacob Vlijm
Mar 20 '14 at 17:51
@Jacob If there is a way to "run it from the terminal" that puts something useful on stderr, that would constitute an answer to this question.
– Kevin Reid
Mar 20 '14 at 17:56
1
@terdon I tried that, and it turned out that (as the next problem) the environment was different in a way that mattered. I want to know how to get more information out of the normal launch process so that I'm not guessing at what's different.
– Kevin Reid
Mar 20 '14 at 18:25
2
@terdon Empirically, running it in the terminal is different — I tried and it was different (in particular a differentPATH
). I want to know how to get exactly the same environment as a normal launch but with more diagnostic info.
– Kevin Reid
Mar 20 '14 at 18:38
2
A bit offtopic, but 9 times of 10 that problem airs it is special characters, like spaces, inExec=
path. Remember, you should haveExec=
in quotes andPath=
without quotes.
– Barafu Albino
Sep 24 '16 at 14:06
|
show 2 more comments
I created a my-app.desktop
file for a program I wrote. When I double-click it, I get the error message "There was an error launching the application". How can I get more detailed information about what the problem is?
I saw a reference to a "details" section of the dialog box, but there is nothing like that present in the one I see. If I were on my Mac, I'd open the Console app to see if any errors were logged, but I haven't learned of anything similar on Ubuntu.
(Note that unlike other similarly-titled questions, I am not asking what's wrong with this particular .desktop file; I want to know how to find out in general.)
launcher .desktop
I created a my-app.desktop
file for a program I wrote. When I double-click it, I get the error message "There was an error launching the application". How can I get more detailed information about what the problem is?
I saw a reference to a "details" section of the dialog box, but there is nothing like that present in the one I see. If I were on my Mac, I'd open the Console app to see if any errors were logged, but I haven't learned of anything similar on Ubuntu.
(Note that unlike other similarly-titled questions, I am not asking what's wrong with this particular .desktop file; I want to know how to find out in general.)
launcher .desktop
launcher .desktop
asked Mar 20 '14 at 17:48
Kevin ReidKevin Reid
5952515
5952515
1
I would just run the Exec line from the terminal and see what the output tells you, but are you sure the desktop file is ok? maybe you should check and run it from the terminal as well.
– Jacob Vlijm
Mar 20 '14 at 17:51
@Jacob If there is a way to "run it from the terminal" that puts something useful on stderr, that would constitute an answer to this question.
– Kevin Reid
Mar 20 '14 at 17:56
1
@terdon I tried that, and it turned out that (as the next problem) the environment was different in a way that mattered. I want to know how to get more information out of the normal launch process so that I'm not guessing at what's different.
– Kevin Reid
Mar 20 '14 at 18:25
2
@terdon Empirically, running it in the terminal is different — I tried and it was different (in particular a differentPATH
). I want to know how to get exactly the same environment as a normal launch but with more diagnostic info.
– Kevin Reid
Mar 20 '14 at 18:38
2
A bit offtopic, but 9 times of 10 that problem airs it is special characters, like spaces, inExec=
path. Remember, you should haveExec=
in quotes andPath=
without quotes.
– Barafu Albino
Sep 24 '16 at 14:06
|
show 2 more comments
1
I would just run the Exec line from the terminal and see what the output tells you, but are you sure the desktop file is ok? maybe you should check and run it from the terminal as well.
– Jacob Vlijm
Mar 20 '14 at 17:51
@Jacob If there is a way to "run it from the terminal" that puts something useful on stderr, that would constitute an answer to this question.
– Kevin Reid
Mar 20 '14 at 17:56
1
@terdon I tried that, and it turned out that (as the next problem) the environment was different in a way that mattered. I want to know how to get more information out of the normal launch process so that I'm not guessing at what's different.
– Kevin Reid
Mar 20 '14 at 18:25
2
@terdon Empirically, running it in the terminal is different — I tried and it was different (in particular a differentPATH
). I want to know how to get exactly the same environment as a normal launch but with more diagnostic info.
– Kevin Reid
Mar 20 '14 at 18:38
2
A bit offtopic, but 9 times of 10 that problem airs it is special characters, like spaces, inExec=
path. Remember, you should haveExec=
in quotes andPath=
without quotes.
– Barafu Albino
Sep 24 '16 at 14:06
1
1
I would just run the Exec line from the terminal and see what the output tells you, but are you sure the desktop file is ok? maybe you should check and run it from the terminal as well.
– Jacob Vlijm
Mar 20 '14 at 17:51
I would just run the Exec line from the terminal and see what the output tells you, but are you sure the desktop file is ok? maybe you should check and run it from the terminal as well.
– Jacob Vlijm
Mar 20 '14 at 17:51
@Jacob If there is a way to "run it from the terminal" that puts something useful on stderr, that would constitute an answer to this question.
– Kevin Reid
Mar 20 '14 at 17:56
@Jacob If there is a way to "run it from the terminal" that puts something useful on stderr, that would constitute an answer to this question.
– Kevin Reid
Mar 20 '14 at 17:56
1
1
@terdon I tried that, and it turned out that (as the next problem) the environment was different in a way that mattered. I want to know how to get more information out of the normal launch process so that I'm not guessing at what's different.
– Kevin Reid
Mar 20 '14 at 18:25
@terdon I tried that, and it turned out that (as the next problem) the environment was different in a way that mattered. I want to know how to get more information out of the normal launch process so that I'm not guessing at what's different.
– Kevin Reid
Mar 20 '14 at 18:25
2
2
@terdon Empirically, running it in the terminal is different — I tried and it was different (in particular a different
PATH
). I want to know how to get exactly the same environment as a normal launch but with more diagnostic info.– Kevin Reid
Mar 20 '14 at 18:38
@terdon Empirically, running it in the terminal is different — I tried and it was different (in particular a different
PATH
). I want to know how to get exactly the same environment as a normal launch but with more diagnostic info.– Kevin Reid
Mar 20 '14 at 18:38
2
2
A bit offtopic, but 9 times of 10 that problem airs it is special characters, like spaces, in
Exec=
path. Remember, you should have Exec=
in quotes and Path=
without quotes.– Barafu Albino
Sep 24 '16 at 14:06
A bit offtopic, but 9 times of 10 that problem airs it is special characters, like spaces, in
Exec=
path. Remember, you should have Exec=
in quotes and Path=
without quotes.– Barafu Albino
Sep 24 '16 at 14:06
|
show 2 more comments
7 Answers
7
active
oldest
votes
Here's a trick you can use. Create a wrapper script for your application that will launch it and capture the error output:
#!/usr/bin/env bash
## Launch 'yourapp' and capture its standard error output
/path/to/yourapp 2>~/myapp.log
Save that as ~/foo.sh
and make it executable with chmod +x ~/foo.sh
. Now, point your desktop launcher to it instead. Something like:
[Desktop Entry]
Version=2.0
Type=Application
Exec=/home/kevin/foo.sh
Terminal=true
Comment=My app!
That will redirect any error messages to ~/myapp.log
and you can examine them at your leisure. You can use 2>>~/myapp.log
if you want successive error messages to be appended to the file instead of overwriting it.
As an aside, the reason that the $PATH
is different is because you are probably setting your $PATH
in ~/.bahsrc
which is not read by the graphical environment. It is also a bad idea since the $PATH
will be set every time you open a new terminal and that is needless overhead. Use ~/.profile
for this instead. For more details on which files are read when see here and for more on which file should be used for what, see here.
Didn't found the problem this way, but the wrapper was working, so I just kept the wrapper as the executable.
– Jānis Elmeris
Jan 29 '18 at 18:49
add a comment |
Found an answer to this question here: https://askubuntu.com/a/836842
Try this :
desktop-file-validate my-app.desktop
It outputs errors in your .desktop
file. For example mine returned :
error: first group is not "Desktrop Entry"
So once I corrected the typo to Desktop Entry
, the script ran successfully.
add a comment |
By running the following command in terminal:
awk -F= '/Exec=/{system($2)}' your_desktop_file.desktop
I am sure that you will find out if there is an error or not in your command assigned to the Exec
field from inside of your .desktop file.
5
I've a similar problem. i execute your command and my.desktop file work perfectly. But when i double click it ,it shows There was an error launching the application
– Sayantan Koley
Jul 10 '16 at 19:02
This answer is kind of funny, since (even though I don't think it does any-much-more than running Exec value in the shell) it made me realize TryExec key was my problem.
– mirh
Dec 4 '18 at 23:13
add a comment |
usually, the terminal(-output) gives you a lot of useful information, both on the application as well as the desktop file. An example:
if I run my application from the terminal, typing the command in the terminal, the application starts.
However, if there is something wrong, you can expect an output like:
Traceback (most recent call last):
File "/home/jacob/Bureaublad/werkmap_2.0/uploaded_versions/2.1.2/32_en_ppa /qle-2.1.2/code/qle_quicklisteditor", line 4044, in <module>
MainWindow()
File "/home/jacob/Bureaublad/werkmap_2.0/uploaded_versions/2.1.2/32_en_ppa /qle-2.1.2/code/qle_quicklisteditor", line 51, in __init__
self.load_sectons()
AttributeError: 'MainWindow' object has no attribute 'load_sectons'
jacob@Jacobwerkkamer:~/Bureaublad/werkmap_2.0/uploaded_versions/2.1.2/32_en_ppa /qle-2.1.2/code$
which gives you a lot of usefull information, even the line in your application that causes the error. (I messed it up on purpose)
The same with the desktop file, just open a terminal in the directory of the .desktop file and drag it on to the terminal. If you for example remove the Exec=
line from a .desktop file, the terminal will tell you it cannot find the command to execute.
To test if the application gives an error, just run what you put after theExec=
string.
The terminal output is usually very specific and useful in bug reports, like here.
2
I know about how to use a terminal and how to troubleshoot a program launch in general. Assuming this approach, what I need to know is how to reproduce the conditions of a .desktop launch accurately in the terminal.
– Kevin Reid
Mar 20 '14 at 18:41
add a comment |
This might help other people - this is the official spec of the desktop launcher files
The important section is : Recognized desktop entry keys - which shows you which values you need.
add a comment |
When I really can't figure it out, I:
cd ~/Desktop
ln -s /my/binary/thatIwanttorun mybinary
Then right click on the default icon that's created and point to a better graphic.
and there should be a <cr> after "cd ~/Desktop"
– Tom
Feb 9 at 21:21
add a comment |
For me, the problem was a missing Icon=
line (which seems like a stupid requirement for a working launcher). My full .desktop file now looks like:
[Desktop Entry]
Name=LiClipse
Comment=Variant of Eclipse
Exec=/home/tsbertalan/bin/liclipse
Terminal=true
Type=Application
Icon=/home/tsbertalan/usr/liclipse/icon.xpm
Which isn't particularly robust to changes in user, but whatever.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f436999%2fhow-do-i-diagnose-there-was-an-error-launching-the-application%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
7 Answers
7
active
oldest
votes
7 Answers
7
active
oldest
votes
active
oldest
votes
active
oldest
votes
Here's a trick you can use. Create a wrapper script for your application that will launch it and capture the error output:
#!/usr/bin/env bash
## Launch 'yourapp' and capture its standard error output
/path/to/yourapp 2>~/myapp.log
Save that as ~/foo.sh
and make it executable with chmod +x ~/foo.sh
. Now, point your desktop launcher to it instead. Something like:
[Desktop Entry]
Version=2.0
Type=Application
Exec=/home/kevin/foo.sh
Terminal=true
Comment=My app!
That will redirect any error messages to ~/myapp.log
and you can examine them at your leisure. You can use 2>>~/myapp.log
if you want successive error messages to be appended to the file instead of overwriting it.
As an aside, the reason that the $PATH
is different is because you are probably setting your $PATH
in ~/.bahsrc
which is not read by the graphical environment. It is also a bad idea since the $PATH
will be set every time you open a new terminal and that is needless overhead. Use ~/.profile
for this instead. For more details on which files are read when see here and for more on which file should be used for what, see here.
Didn't found the problem this way, but the wrapper was working, so I just kept the wrapper as the executable.
– Jānis Elmeris
Jan 29 '18 at 18:49
add a comment |
Here's a trick you can use. Create a wrapper script for your application that will launch it and capture the error output:
#!/usr/bin/env bash
## Launch 'yourapp' and capture its standard error output
/path/to/yourapp 2>~/myapp.log
Save that as ~/foo.sh
and make it executable with chmod +x ~/foo.sh
. Now, point your desktop launcher to it instead. Something like:
[Desktop Entry]
Version=2.0
Type=Application
Exec=/home/kevin/foo.sh
Terminal=true
Comment=My app!
That will redirect any error messages to ~/myapp.log
and you can examine them at your leisure. You can use 2>>~/myapp.log
if you want successive error messages to be appended to the file instead of overwriting it.
As an aside, the reason that the $PATH
is different is because you are probably setting your $PATH
in ~/.bahsrc
which is not read by the graphical environment. It is also a bad idea since the $PATH
will be set every time you open a new terminal and that is needless overhead. Use ~/.profile
for this instead. For more details on which files are read when see here and for more on which file should be used for what, see here.
Didn't found the problem this way, but the wrapper was working, so I just kept the wrapper as the executable.
– Jānis Elmeris
Jan 29 '18 at 18:49
add a comment |
Here's a trick you can use. Create a wrapper script for your application that will launch it and capture the error output:
#!/usr/bin/env bash
## Launch 'yourapp' and capture its standard error output
/path/to/yourapp 2>~/myapp.log
Save that as ~/foo.sh
and make it executable with chmod +x ~/foo.sh
. Now, point your desktop launcher to it instead. Something like:
[Desktop Entry]
Version=2.0
Type=Application
Exec=/home/kevin/foo.sh
Terminal=true
Comment=My app!
That will redirect any error messages to ~/myapp.log
and you can examine them at your leisure. You can use 2>>~/myapp.log
if you want successive error messages to be appended to the file instead of overwriting it.
As an aside, the reason that the $PATH
is different is because you are probably setting your $PATH
in ~/.bahsrc
which is not read by the graphical environment. It is also a bad idea since the $PATH
will be set every time you open a new terminal and that is needless overhead. Use ~/.profile
for this instead. For more details on which files are read when see here and for more on which file should be used for what, see here.
Here's a trick you can use. Create a wrapper script for your application that will launch it and capture the error output:
#!/usr/bin/env bash
## Launch 'yourapp' and capture its standard error output
/path/to/yourapp 2>~/myapp.log
Save that as ~/foo.sh
and make it executable with chmod +x ~/foo.sh
. Now, point your desktop launcher to it instead. Something like:
[Desktop Entry]
Version=2.0
Type=Application
Exec=/home/kevin/foo.sh
Terminal=true
Comment=My app!
That will redirect any error messages to ~/myapp.log
and you can examine them at your leisure. You can use 2>>~/myapp.log
if you want successive error messages to be appended to the file instead of overwriting it.
As an aside, the reason that the $PATH
is different is because you are probably setting your $PATH
in ~/.bahsrc
which is not read by the graphical environment. It is also a bad idea since the $PATH
will be set every time you open a new terminal and that is needless overhead. Use ~/.profile
for this instead. For more details on which files are read when see here and for more on which file should be used for what, see here.
edited Mar 20 '17 at 10:18
Community♦
1
1
answered Mar 20 '14 at 19:01
terdon♦terdon
67.5k13139223
67.5k13139223
Didn't found the problem this way, but the wrapper was working, so I just kept the wrapper as the executable.
– Jānis Elmeris
Jan 29 '18 at 18:49
add a comment |
Didn't found the problem this way, but the wrapper was working, so I just kept the wrapper as the executable.
– Jānis Elmeris
Jan 29 '18 at 18:49
Didn't found the problem this way, but the wrapper was working, so I just kept the wrapper as the executable.
– Jānis Elmeris
Jan 29 '18 at 18:49
Didn't found the problem this way, but the wrapper was working, so I just kept the wrapper as the executable.
– Jānis Elmeris
Jan 29 '18 at 18:49
add a comment |
Found an answer to this question here: https://askubuntu.com/a/836842
Try this :
desktop-file-validate my-app.desktop
It outputs errors in your .desktop
file. For example mine returned :
error: first group is not "Desktrop Entry"
So once I corrected the typo to Desktop Entry
, the script ran successfully.
add a comment |
Found an answer to this question here: https://askubuntu.com/a/836842
Try this :
desktop-file-validate my-app.desktop
It outputs errors in your .desktop
file. For example mine returned :
error: first group is not "Desktrop Entry"
So once I corrected the typo to Desktop Entry
, the script ran successfully.
add a comment |
Found an answer to this question here: https://askubuntu.com/a/836842
Try this :
desktop-file-validate my-app.desktop
It outputs errors in your .desktop
file. For example mine returned :
error: first group is not "Desktrop Entry"
So once I corrected the typo to Desktop Entry
, the script ran successfully.
Found an answer to this question here: https://askubuntu.com/a/836842
Try this :
desktop-file-validate my-app.desktop
It outputs errors in your .desktop
file. For example mine returned :
error: first group is not "Desktrop Entry"
So once I corrected the typo to Desktop Entry
, the script ran successfully.
edited Sep 13 '17 at 23:40
answered Sep 13 '17 at 16:02
JimmyJimmy
21125
21125
add a comment |
add a comment |
By running the following command in terminal:
awk -F= '/Exec=/{system($2)}' your_desktop_file.desktop
I am sure that you will find out if there is an error or not in your command assigned to the Exec
field from inside of your .desktop file.
5
I've a similar problem. i execute your command and my.desktop file work perfectly. But when i double click it ,it shows There was an error launching the application
– Sayantan Koley
Jul 10 '16 at 19:02
This answer is kind of funny, since (even though I don't think it does any-much-more than running Exec value in the shell) it made me realize TryExec key was my problem.
– mirh
Dec 4 '18 at 23:13
add a comment |
By running the following command in terminal:
awk -F= '/Exec=/{system($2)}' your_desktop_file.desktop
I am sure that you will find out if there is an error or not in your command assigned to the Exec
field from inside of your .desktop file.
5
I've a similar problem. i execute your command and my.desktop file work perfectly. But when i double click it ,it shows There was an error launching the application
– Sayantan Koley
Jul 10 '16 at 19:02
This answer is kind of funny, since (even though I don't think it does any-much-more than running Exec value in the shell) it made me realize TryExec key was my problem.
– mirh
Dec 4 '18 at 23:13
add a comment |
By running the following command in terminal:
awk -F= '/Exec=/{system($2)}' your_desktop_file.desktop
I am sure that you will find out if there is an error or not in your command assigned to the Exec
field from inside of your .desktop file.
By running the following command in terminal:
awk -F= '/Exec=/{system($2)}' your_desktop_file.desktop
I am sure that you will find out if there is an error or not in your command assigned to the Exec
field from inside of your .desktop file.
answered Mar 20 '14 at 19:56
Radu RădeanuRadu Rădeanu
120k35253328
120k35253328
5
I've a similar problem. i execute your command and my.desktop file work perfectly. But when i double click it ,it shows There was an error launching the application
– Sayantan Koley
Jul 10 '16 at 19:02
This answer is kind of funny, since (even though I don't think it does any-much-more than running Exec value in the shell) it made me realize TryExec key was my problem.
– mirh
Dec 4 '18 at 23:13
add a comment |
5
I've a similar problem. i execute your command and my.desktop file work perfectly. But when i double click it ,it shows There was an error launching the application
– Sayantan Koley
Jul 10 '16 at 19:02
This answer is kind of funny, since (even though I don't think it does any-much-more than running Exec value in the shell) it made me realize TryExec key was my problem.
– mirh
Dec 4 '18 at 23:13
5
5
I've a similar problem. i execute your command and my.desktop file work perfectly. But when i double click it ,it shows There was an error launching the application
– Sayantan Koley
Jul 10 '16 at 19:02
I've a similar problem. i execute your command and my.desktop file work perfectly. But when i double click it ,it shows There was an error launching the application
– Sayantan Koley
Jul 10 '16 at 19:02
This answer is kind of funny, since (even though I don't think it does any-much-more than running Exec value in the shell) it made me realize TryExec key was my problem.
– mirh
Dec 4 '18 at 23:13
This answer is kind of funny, since (even though I don't think it does any-much-more than running Exec value in the shell) it made me realize TryExec key was my problem.
– mirh
Dec 4 '18 at 23:13
add a comment |
usually, the terminal(-output) gives you a lot of useful information, both on the application as well as the desktop file. An example:
if I run my application from the terminal, typing the command in the terminal, the application starts.
However, if there is something wrong, you can expect an output like:
Traceback (most recent call last):
File "/home/jacob/Bureaublad/werkmap_2.0/uploaded_versions/2.1.2/32_en_ppa /qle-2.1.2/code/qle_quicklisteditor", line 4044, in <module>
MainWindow()
File "/home/jacob/Bureaublad/werkmap_2.0/uploaded_versions/2.1.2/32_en_ppa /qle-2.1.2/code/qle_quicklisteditor", line 51, in __init__
self.load_sectons()
AttributeError: 'MainWindow' object has no attribute 'load_sectons'
jacob@Jacobwerkkamer:~/Bureaublad/werkmap_2.0/uploaded_versions/2.1.2/32_en_ppa /qle-2.1.2/code$
which gives you a lot of usefull information, even the line in your application that causes the error. (I messed it up on purpose)
The same with the desktop file, just open a terminal in the directory of the .desktop file and drag it on to the terminal. If you for example remove the Exec=
line from a .desktop file, the terminal will tell you it cannot find the command to execute.
To test if the application gives an error, just run what you put after theExec=
string.
The terminal output is usually very specific and useful in bug reports, like here.
2
I know about how to use a terminal and how to troubleshoot a program launch in general. Assuming this approach, what I need to know is how to reproduce the conditions of a .desktop launch accurately in the terminal.
– Kevin Reid
Mar 20 '14 at 18:41
add a comment |
usually, the terminal(-output) gives you a lot of useful information, both on the application as well as the desktop file. An example:
if I run my application from the terminal, typing the command in the terminal, the application starts.
However, if there is something wrong, you can expect an output like:
Traceback (most recent call last):
File "/home/jacob/Bureaublad/werkmap_2.0/uploaded_versions/2.1.2/32_en_ppa /qle-2.1.2/code/qle_quicklisteditor", line 4044, in <module>
MainWindow()
File "/home/jacob/Bureaublad/werkmap_2.0/uploaded_versions/2.1.2/32_en_ppa /qle-2.1.2/code/qle_quicklisteditor", line 51, in __init__
self.load_sectons()
AttributeError: 'MainWindow' object has no attribute 'load_sectons'
jacob@Jacobwerkkamer:~/Bureaublad/werkmap_2.0/uploaded_versions/2.1.2/32_en_ppa /qle-2.1.2/code$
which gives you a lot of usefull information, even the line in your application that causes the error. (I messed it up on purpose)
The same with the desktop file, just open a terminal in the directory of the .desktop file and drag it on to the terminal. If you for example remove the Exec=
line from a .desktop file, the terminal will tell you it cannot find the command to execute.
To test if the application gives an error, just run what you put after theExec=
string.
The terminal output is usually very specific and useful in bug reports, like here.
2
I know about how to use a terminal and how to troubleshoot a program launch in general. Assuming this approach, what I need to know is how to reproduce the conditions of a .desktop launch accurately in the terminal.
– Kevin Reid
Mar 20 '14 at 18:41
add a comment |
usually, the terminal(-output) gives you a lot of useful information, both on the application as well as the desktop file. An example:
if I run my application from the terminal, typing the command in the terminal, the application starts.
However, if there is something wrong, you can expect an output like:
Traceback (most recent call last):
File "/home/jacob/Bureaublad/werkmap_2.0/uploaded_versions/2.1.2/32_en_ppa /qle-2.1.2/code/qle_quicklisteditor", line 4044, in <module>
MainWindow()
File "/home/jacob/Bureaublad/werkmap_2.0/uploaded_versions/2.1.2/32_en_ppa /qle-2.1.2/code/qle_quicklisteditor", line 51, in __init__
self.load_sectons()
AttributeError: 'MainWindow' object has no attribute 'load_sectons'
jacob@Jacobwerkkamer:~/Bureaublad/werkmap_2.0/uploaded_versions/2.1.2/32_en_ppa /qle-2.1.2/code$
which gives you a lot of usefull information, even the line in your application that causes the error. (I messed it up on purpose)
The same with the desktop file, just open a terminal in the directory of the .desktop file and drag it on to the terminal. If you for example remove the Exec=
line from a .desktop file, the terminal will tell you it cannot find the command to execute.
To test if the application gives an error, just run what you put after theExec=
string.
The terminal output is usually very specific and useful in bug reports, like here.
usually, the terminal(-output) gives you a lot of useful information, both on the application as well as the desktop file. An example:
if I run my application from the terminal, typing the command in the terminal, the application starts.
However, if there is something wrong, you can expect an output like:
Traceback (most recent call last):
File "/home/jacob/Bureaublad/werkmap_2.0/uploaded_versions/2.1.2/32_en_ppa /qle-2.1.2/code/qle_quicklisteditor", line 4044, in <module>
MainWindow()
File "/home/jacob/Bureaublad/werkmap_2.0/uploaded_versions/2.1.2/32_en_ppa /qle-2.1.2/code/qle_quicklisteditor", line 51, in __init__
self.load_sectons()
AttributeError: 'MainWindow' object has no attribute 'load_sectons'
jacob@Jacobwerkkamer:~/Bureaublad/werkmap_2.0/uploaded_versions/2.1.2/32_en_ppa /qle-2.1.2/code$
which gives you a lot of usefull information, even the line in your application that causes the error. (I messed it up on purpose)
The same with the desktop file, just open a terminal in the directory of the .desktop file and drag it on to the terminal. If you for example remove the Exec=
line from a .desktop file, the terminal will tell you it cannot find the command to execute.
To test if the application gives an error, just run what you put after theExec=
string.
The terminal output is usually very specific and useful in bug reports, like here.
answered Mar 20 '14 at 18:24
Jacob VlijmJacob Vlijm
66k9130229
66k9130229
2
I know about how to use a terminal and how to troubleshoot a program launch in general. Assuming this approach, what I need to know is how to reproduce the conditions of a .desktop launch accurately in the terminal.
– Kevin Reid
Mar 20 '14 at 18:41
add a comment |
2
I know about how to use a terminal and how to troubleshoot a program launch in general. Assuming this approach, what I need to know is how to reproduce the conditions of a .desktop launch accurately in the terminal.
– Kevin Reid
Mar 20 '14 at 18:41
2
2
I know about how to use a terminal and how to troubleshoot a program launch in general. Assuming this approach, what I need to know is how to reproduce the conditions of a .desktop launch accurately in the terminal.
– Kevin Reid
Mar 20 '14 at 18:41
I know about how to use a terminal and how to troubleshoot a program launch in general. Assuming this approach, what I need to know is how to reproduce the conditions of a .desktop launch accurately in the terminal.
– Kevin Reid
Mar 20 '14 at 18:41
add a comment |
This might help other people - this is the official spec of the desktop launcher files
The important section is : Recognized desktop entry keys - which shows you which values you need.
add a comment |
This might help other people - this is the official spec of the desktop launcher files
The important section is : Recognized desktop entry keys - which shows you which values you need.
add a comment |
This might help other people - this is the official spec of the desktop launcher files
The important section is : Recognized desktop entry keys - which shows you which values you need.
This might help other people - this is the official spec of the desktop launcher files
The important section is : Recognized desktop entry keys - which shows you which values you need.
answered Jun 15 '14 at 17:50
Tony Suffolk 66Tony Suffolk 66
638
638
add a comment |
add a comment |
When I really can't figure it out, I:
cd ~/Desktop
ln -s /my/binary/thatIwanttorun mybinary
Then right click on the default icon that's created and point to a better graphic.
and there should be a <cr> after "cd ~/Desktop"
– Tom
Feb 9 at 21:21
add a comment |
When I really can't figure it out, I:
cd ~/Desktop
ln -s /my/binary/thatIwanttorun mybinary
Then right click on the default icon that's created and point to a better graphic.
and there should be a <cr> after "cd ~/Desktop"
– Tom
Feb 9 at 21:21
add a comment |
When I really can't figure it out, I:
cd ~/Desktop
ln -s /my/binary/thatIwanttorun mybinary
Then right click on the default icon that's created and point to a better graphic.
When I really can't figure it out, I:
cd ~/Desktop
ln -s /my/binary/thatIwanttorun mybinary
Then right click on the default icon that's created and point to a better graphic.
edited Feb 9 at 21:41
Kevin Bowen
14.8k155970
14.8k155970
answered Feb 9 at 21:20
TomTom
1
1
and there should be a <cr> after "cd ~/Desktop"
– Tom
Feb 9 at 21:21
add a comment |
and there should be a <cr> after "cd ~/Desktop"
– Tom
Feb 9 at 21:21
and there should be a <cr> after "cd ~/Desktop"
– Tom
Feb 9 at 21:21
and there should be a <cr> after "cd ~/Desktop"
– Tom
Feb 9 at 21:21
add a comment |
For me, the problem was a missing Icon=
line (which seems like a stupid requirement for a working launcher). My full .desktop file now looks like:
[Desktop Entry]
Name=LiClipse
Comment=Variant of Eclipse
Exec=/home/tsbertalan/bin/liclipse
Terminal=true
Type=Application
Icon=/home/tsbertalan/usr/liclipse/icon.xpm
Which isn't particularly robust to changes in user, but whatever.
add a comment |
For me, the problem was a missing Icon=
line (which seems like a stupid requirement for a working launcher). My full .desktop file now looks like:
[Desktop Entry]
Name=LiClipse
Comment=Variant of Eclipse
Exec=/home/tsbertalan/bin/liclipse
Terminal=true
Type=Application
Icon=/home/tsbertalan/usr/liclipse/icon.xpm
Which isn't particularly robust to changes in user, but whatever.
add a comment |
For me, the problem was a missing Icon=
line (which seems like a stupid requirement for a working launcher). My full .desktop file now looks like:
[Desktop Entry]
Name=LiClipse
Comment=Variant of Eclipse
Exec=/home/tsbertalan/bin/liclipse
Terminal=true
Type=Application
Icon=/home/tsbertalan/usr/liclipse/icon.xpm
Which isn't particularly robust to changes in user, but whatever.
For me, the problem was a missing Icon=
line (which seems like a stupid requirement for a working launcher). My full .desktop file now looks like:
[Desktop Entry]
Name=LiClipse
Comment=Variant of Eclipse
Exec=/home/tsbertalan/bin/liclipse
Terminal=true
Type=Application
Icon=/home/tsbertalan/usr/liclipse/icon.xpm
Which isn't particularly robust to changes in user, but whatever.
answered Apr 22 '14 at 0:30
tsbertalantsbertalan
329210
329210
add a comment |
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f436999%2fhow-do-i-diagnose-there-was-an-error-launching-the-application%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
I would just run the Exec line from the terminal and see what the output tells you, but are you sure the desktop file is ok? maybe you should check and run it from the terminal as well.
– Jacob Vlijm
Mar 20 '14 at 17:51
@Jacob If there is a way to "run it from the terminal" that puts something useful on stderr, that would constitute an answer to this question.
– Kevin Reid
Mar 20 '14 at 17:56
1
@terdon I tried that, and it turned out that (as the next problem) the environment was different in a way that mattered. I want to know how to get more information out of the normal launch process so that I'm not guessing at what's different.
– Kevin Reid
Mar 20 '14 at 18:25
2
@terdon Empirically, running it in the terminal is different — I tried and it was different (in particular a different
PATH
). I want to know how to get exactly the same environment as a normal launch but with more diagnostic info.– Kevin Reid
Mar 20 '14 at 18:38
2
A bit offtopic, but 9 times of 10 that problem airs it is special characters, like spaces, in
Exec=
path. Remember, you should haveExec=
in quotes andPath=
without quotes.– Barafu Albino
Sep 24 '16 at 14:06