Creating a Desktop shortcut to a Java Application.

Latest response

I am using a ApacheJMeter tool for testing. I launch the tool in a terminal window using the command:

java -jar ApachedJMeter.jar

I would like to create a desktop shortcut to launch the app. My RHEL 7 Desktop does NOT have internet access (closed and secure facility) and I do not have the launcher tool to create and edit shortcuts like this.

Any ideas?

Responses

Hi Dale,

You can do this by creating a .desktop file for your application. In this case, it could look like the following:

[Desktop Entry]
Type=Application
Encoding=UTF-8
Name=ApacheJMeter
Comment=ApacheJMeter
Exec=java -jar ApachedJMeter.jar
Icon=jmeter-icon.png
Terminal=false

Name this file, for example, apachejmeter.desktop and save it in the ~/Desktop directory. An icon should then appear on your desktop. Clicking on that icon launches your app. Note that it will ask you whether you want to mark that app launcher as trusted. Just confirm it, and you're done.

See the Desktop Entry Files chapter in the Desktop Migration Guide for more details. It also contains instructions on how to customize the desktop menus.

This worked really well, thank you very much.