2

I downloaded and installed XMind, it came as a .zip folder as opposed to .deb file which means I had to install it using a bash script.

I put the extracted files into a temporary folder called .installed in my home folder.

I'm trying to create a desktop launcher for the executable that came with the installation at /home/user01/.installed/xmind-8-linux/XMind_amd64/XMind.

I created a .desktop file like this:

[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Exec=/home/user01/.installed/xmind-8-linux/XMind_amd64/XMind
Name=XMind
Comment=Mind mapping software
Icon=/home/user01/Pictures/Icons/new_branding_new_logo.png

And I placed it in /usr/share/applications/.

The problem is that whenever I try to run the application I get this error:

enter image description here

Clicking on the executable directly launches the application normally and the error is the same regardless of who owns the file (root or user) so I don't understand what I'm doing wrong. Any advice would be great.

Also, the error log says this:

!SESSION 2016-11-16 14:14:38.215 -----------------------------------------------
eclipse.buildId=R3.7.0.201611010032
java.version=1.8.0_111
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_GB
Command-line arguments:  -os linux -ws gtk -arch x86_64 -data ../workspace

!ENTRY org.eclipse.osgi 4 0 2016-11-16 14:14:38.410
!MESSAGE Application error
!STACK 1
java.lang.IllegalStateException: Unable to acquire application service. Ensure that the org.eclipse.core.runtime bundle is resolved and started (see config.ini).
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:78)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:673)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:610)
at org.eclipse.equinox.launcher.Main.run(Main.java:1519)
at org.eclipse.equinox.launcher.Main.main(Main.java:1492)

Update:
Running ./XMind from the terminal works as expected.
Running the whole path /home/user01/.installed/xmind-8-linux/XMind_amd64/XMind creates an error.
When the error happens the application creates a configuration folder in ~/ directory, which is normally located in the same folder as the executable. I still don't understand what's happening here.

Solution:

(Thanks to Katu) This is how I managed to solve the problem:

Create a bash script in the same location as the executable called xmind.sh

Enter inside the file:

#!/bin/bash

(cd /home/user01/.installed/xmind-8-linux/XMind_amd64/ && ./XMind)

Create a .desktop launcher with the new script instead of the executable.

[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Exec=/home/user01/.installed/xmind-8-linux/XMind_amd64/xmind.sh
Name=XMind
Comment=Mind mapping software
Icon=/home/user01/Pictures/Icons/new_branding_new_logo.png
8
  • Check if it works from the terminal. If /home/user01/.installed/xmind-8-linux/XMind_amd64/XMind command doesn't work, your problem is not with the .desktop file. You might need to add a path variable? In case is trying to create a folder in the current folder.
    – Katu
    Nov 16, 2016 at 12:48
  • 1
    Running it in the terminal gives a different error: An error has occured. See the log file /home/user01/configuration/1478305678289.log and the terminal prints out: Gtk-Message: GtkDialog mapped without a transient parent. This is discouraged.
    – Rtsne42
    Nov 16, 2016 at 14:14
  • I added the log contents.
    – Rtsne42
    Nov 16, 2016 at 14:20
  • I would try to fix that first before attempting the .desktop file. Check the log file. Maybe try to run it from it's own folder, with sudo or try to find out what command runs when you click the executable, which you said it works.
    – Katu
    Nov 16, 2016 at 14:21
  • I updated the post with some additional details. It behaves oddly.
    – Rtsne42
    Nov 16, 2016 at 14:30

3 Answers 3

4

When you run it as ./Xmind, your current directory is the same directory as the Xmind executable. To duplicate that effect in a .desktop file, add a Path= line to set the working directory:

Path=/home/user01/.installed/xmind-8-linux/XMind_amd64/

For more information, see the .desktop file specification on what the Path entry does.


I'd also recommend moving the .desktop file from /usr/share/applications to /home/user01/.local/share/applications/, since, if you store the application within your home directory, it's probably an application just for you, rather than all users on the system.

0

It seems that Xmind will attempt to create a folder in the place it is executed from. You will have to tell the .desktop file to move to that location before executing it. From this post, try something like this:

Exec=bash -c "export PATH=$PATH:`dirname %k`; your_command"
0

Thanks for all information.

I had the same issue, but found a way to simplify using Arronax. It is described in this discussion.

Arronax does the job, as it is possible to specify in what folder the app (XMind) should be started.

Hope this helps,
Phil

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .