When I create a .desktop file to launch eclipse (latest build with JDK 1.8 support) I get the following error:
A Java Runtime Environment (JRE) or Java Development Kit (JDK)
must be available in order to run Eclipse. No Java virtual machine
was found after searching the following locations:
/home/dean/bin/eclipse-standard-luna-M5-linux-gtk-x86_64/eclipse/jre/bin/java
java in your current PATH
Why does it try to find the JRE under the directory where the eclipse binary is?
I can launch Eclipse from the command line, and I can pin it to the launcher and it works. Why is the .desktop file so confused about what it is supposed to do?
Here is my .desktop file:
[Desktop Entry]
Version=1.0
Name=Eclipse JDK 1.8
Comment=Eclipse
Exec=/home/dean/bin/eclipse-standard-luna-M5-linux-gtk-x86_64/eclipse/eclipse
Icon=/home/dean/bin/eclipse-standard-luna-M5-linux-gtk-x86_64/eclipse/icon.xpm
Terminal=false
Type=Application
Categories=Utility;Application;
The problem I'm having is not what was asked in the question linked above as a duplice. My issue is because my PATH to the JDK is set in my .bashrc.
Exec=env PATH=/home/dean/bin/jdk1.8.0/bin:$PATH /home/dean/bin/eclipse-standard-luna-M5-linux-gtk-x86_64/eclipse/eclipse
The docs for the .desktop file were no help. – Dean Schulze Feb 10 '14 at 18:16Exec=env PATH= ...
, that's what I meant in my last line. Normally you would like to set up PATH in .profile, not .bashrc. The .profile file is parsed by the login shell so it will set up PATH correctly when you login, and then there will be no need for theenv
workaround. On Debian/Ubuntu .profile sources .bashrc, so this shouldn't be a problem, but maybe your .profile is not doing it, so check it. Or you have a .bash_profile or .bash_login file which overrides the .profile settings. – falconer Feb 10 '14 at 20:12/root/.profile
only sources the~/.bashrc
whenif [ "$BASH" ];
returns true. The Unity desktop would have to appear as a Bash shell for my .bashrc to get sourced by .profile. – Dean Schulze Feb 10 '14 at 23:49lightdm
sources~/.profile
as the default shell of the user, which is by defaultbash
. But as I never had problems with these things it was just an assumption. Indeed, looking at this bugreport,lightdm
sources~/.profile
assh
, so.bashrc
is not sourced. But to be short: Just declare your PATH in~/.profile
instead of~/.bashrc
and everything will be in order. (I don't know why you are referring to/root/.profile
, you need your users~/.profile
.) – falconer Feb 11 '14 at 00:04