Xfce Forum

Sub domains
 

You are not logged in.

#1 2016-06-05 14:54:44

cmcanulty
Member
From: Beulah, Michigan
Registered: 2014-05-10
Posts: 260

put jar program in panel

I can successfully put shortcut to a program that is an executable jar on the desktop. But what I want to do is add it to the whisker menu. The path is

/home/cmcanultyimprovisor820/improvisor.jar

and it is marked executable. I tried to crate a launcher with

java-jar /home/cmcanultyimprovisor820/improvisor.jar

and I get an error of

Failed to run "Improvisor.desktop"  failed to execute child process "java-jar" no such file or directory

I really would not like to have it on the desktop but only in the whisker menu. I tried several tutorials but none work. I have it to open with

"Oracle Java 8 Runtime"

The upgrade to 16.04 broke jdk I believe because it installed jdk8 but also a header from jdk9, so I installed Oracle 8 and it works fine with no extra tweaking for jar files but doesn't put them in the menu

Last edited by cmcanulty (2016-06-05 15:03:10)

Offline

#2 2016-06-05 16:02:43

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,000

Re: put jar program in panel

"java-jar" should be "java -jar" (note the space).


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#3 2016-06-05 17:53:06

cmcanulty
Member
From: Beulah, Michigan
Registered: 2014-05-10
Posts: 260

Re: put jar program in panel

Ok I now have the command as below and no error message but also it does nothing. It is executable
java -jar  /home/cmcanulty/improvisor820/improvisor.jar

Offline

#4 2016-06-05 18:32:42

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,000

Re: put jar program in panel

What error message do you get now?


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#5 2016-06-05 18:49:25

cmcanulty
Member
From: Beulah, Michigan
Registered: 2014-05-10
Posts: 260

Re: put jar program in panel

No error message and does nothing

Offline

#6 2016-06-05 18:59:56

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,000

Re: put jar program in panel

And if you run that same command in a terminal window, does it work fine?

What is improvisor? Is the jar file available somewhere that I can download and test?


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#7 2016-06-05 21:06:03

cmcanulty
Member
From: Beulah, Michigan
Registered: 2014-05-10
Posts: 260

Re: put jar program in panel

It is a music notation app available here and here. It works fine with a shortcut to it from the desktop but I often would like to put jar programs in the menu, for example minecraft.edu which we use at the library, thank you

https://www.cs.hmc.edu/~keller/jazz/improvisor/

https://sourceforge.net/projects/impro-visor/

Last edited by cmcanulty (2016-06-05 21:45:45)

Offline

#8 2016-06-05 23:50:30

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,000

Re: put jar program in panel

This .desktop file worked for me:

[Desktop Entry]
Name=Improvisor
GenericName=Improvisation Advisor
Comment=A Music notation program for improvization

Icon=music

Type=Application
Categories=AudioVideo;Audio;AudioVideoEditing;

Exec=java -jar /home/toz/Downloads/improvisor/improvisor.jar
StartupNotify=false
Terminal=false

Change the "Exec=" line to point to your copy of the jar file, change the "Icon=" line to point to your icon of choice, name the file "improvisor.desktop" and drop it in ~/.local/share/applications.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#9 2016-06-06 11:28:12

cmcanulty
Member
From: Beulah, Michigan
Registered: 2014-05-10
Posts: 260

Re: put jar program in panel

OK great that works, now I'll do it for all the library machines for minecraft.edu
I think what I was doing wrong was trying to do it through whisker add launcher instead of putting it in /.local/share/applications
thank you!

Offline

#10 2016-06-06 14:36:54

cmcanulty
Member
From: Beulah, Michigan
Registered: 2014-05-10
Posts: 260

Re: put jar program in panel

OK this gets really complicated I successfully added minecraftedu to the whisker menu by creating this file in ./local/share/applications

[Desktop Entry]
Version=1.0
Type=Application
Name=Minecraftedu
GenericName=Minecraft
Comment=Multiplayer game
Icon=/home/cmcanulty/Documents/Minecraftedulauncher.png
Exec= java -jar  /home/cmcanulty/minecraftedu/Launcher.jar
NoDisplay=false
Categories=Game;
StartupNotify=false
Terminal=false

This works fine but then I rt cl it and click add to desktop, the desktop icon won't open minecraftedu which was my goal all along, instead it gives an error saying the install directory needs read write permissions which it has. Why would it work from the menu but not the desktop? This seems like an issue that should have a simpler solution as I have worked on this for 2 days just to get a desktop shortcut to a jar application and have been unsuccessful. The reason I need this is kids need to be able to launch minecraftedu from a recognizable desktop icon, not by searching through menus and files. Thank you

Offline

#11 2016-06-06 16:56:54

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,000

Re: put jar program in panel

cmcanulty wrote:

This works fine but then I rt cl it and click add to desktop,

Do you mean right-click and select "Send To > Desktop (Create Link)?"

Can you post back the results of:

ls -l ~/Desktop

...and:

cat ~/Desktop/minecraftedu.desktop

(or whatever the name of the minecraftedu desktop file on the Desktop is).


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#12 2016-06-06 20:32:47

cmcanulty
Member
From: Beulah, Michigan
Registered: 2014-05-10
Posts: 260

Re: put jar program in panel

Yes I meant I right clicked on the whisker menu entry I made for minecraftedu (which works) and said add to desktop but the desktop one doesn't work

cmcanulty@ubuntu1:~$ ls -l ~/Desktop
total 28
drwxrwxr-x 2 cmcanulty cmcanulty 4096 Jun  5 10:24 Arctic Climate Class
drwxrwxr-x 2 cmcanulty cmcanulty 4096 Jun  5 10:24 Chair
-rw-r--r-- 1 cmcanulty cmcanulty  181 May 28 18:32 CNN.desktop
-rw-r--r-- 1 cmcanulty cmcanulty  135 Apr 11 14:25 Conviction.desktop
-rwxrwxrwx 1 cmcanulty cmcanulty  203 Jun  5 13:51 Improvisor0.desktop
-rwxrwxr-x 1 cmcanulty cmcanulty  229 Jun  6 10:39 Minecraftedu.desktop
-rw-rw-r-- 1 cmcanulty cmcanulty   57 Jun  5 13:52 Test Launcher
cmcanulty@ubuntu1:~$ cat ~/Desktop/minecraftedu.desktop
cat: /home/cmcanulty/Desktop/minecraftedu.desktop: No such file or directory
cmcanulty@ubuntu1:~$

Offline

#13 2016-06-06 21:34:55

MountainDewManiac
Member
From: Where Mr. Bankruptcy is Prez
Registered: 2013-03-24
Posts: 1,115

Re: put jar program in panel

cmcanulty wrote:

-rwxrwxr-x 1 cmcanulty cmcanulty  229 Jun  6 10:39 Minecraftedu.desktop

cmcanulty wrote:

cmcanulty@ubuntu1:~$ cat ~/Desktop/minecraftedu.desktop
cat: /home/cmcanulty/Desktop/minecraftedu.desktop: No such file or directory
cmcanulty@ubuntu1:~$

Try again, only with the same filename instead of a different one this time.

Regards,
MDM

Last edited by MountainDewManiac (2016-06-06 21:37:04)


Mountain Dew Maniac

How to Ask for Help <=== Click on this link

Offline

#14 2016-06-06 21:51:44

cmcanulty
Member
From: Beulah, Michigan
Registered: 2014-05-10
Posts: 260

Re: put jar program in panel

OK I renamed the desktop to minecraftedu but all I am doing is right clicking the menu entry and saying add to desktop. After renaming to a small m on desktop I get the same output and the same error when I try to open the desktop shortcut of needing read write permissions which it has

cmcanulty@ubuntu1:~$ ls -l ~/Desktop
total 28
drwxrwxr-x 2 cmcanulty cmcanulty 4096 Jun  5 10:24 Arctic Climate Class
drwxrwxr-x 2 cmcanulty cmcanulty 4096 Jun  5 10:24 Chair
-rw-r--r-- 1 cmcanulty cmcanulty  181 May 28 18:32 CNN.desktop
-rw-r--r-- 1 cmcanulty cmcanulty  135 Apr 11 14:25 Conviction.desktop
-rwxrwxrwx 1 cmcanulty cmcanulty  203 Jun  5 13:51 Improvisor0.desktop
-rwxrwxrwx 1 cmcanulty cmcanulty  254 Jun  6 17:45 Minecraftedu.desktop
-rw-rw-r-- 1 cmcanulty cmcanulty   57 Jun  5 13:52 Test Launcher
cmcanulty@ubuntu1:~$ cat ~/Desktop/minecraftedu.desktop
cat: /home/cmcanulty/Desktop/minecraftedu.desktop: No such file or directory
cmcanulty@ubuntu1:~$

Last edited by cmcanulty (2016-06-06 21:56:15)

Offline

#15 2016-06-06 23:46:29

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,000

Re: put jar program in panel

Try:

cat ~/Desktop/Minecraftedu.desktop

Is there a Minecraftedu.desktop file in ~/.local/share/applications?


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#16 2016-06-07 11:46:24

cmcanulty
Member
From: Beulah, Michigan
Registered: 2014-05-10
Posts: 260

Re: put jar program in panel

Yes here it is, note, I checked  the caps on the file path are the same as the files

[Desktop Entry]
Version=1.0
Type=Application
Name=Minecraftedu
GenericName=Minecraft
Comment=Multiplayer game
Icon=/home/cmcanulty/Documents/Minecraftedulauncher.png
Exec=java -jar  /home/cmcanulty/minecraftedu/Launcher.jar
NoDisplay=false
Categories=Game;
StartupNotify=false
Terminal=false
Name[en_CA]=minecraftedu

Offline

#17 2016-06-07 23:16:24

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,000

Re: put jar program in panel

That's strange because that desktop file works for me. What does the following return:

ls -l /home/cmcanulty/minecraftedu

Can you also try running the following from a terminal window and post back the results:

exo-open ~/Desktop/Minecraftedu.desktop

Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#18 2016-06-08 04:30:37

poltiser
Member
Registered: 2011-05-14
Posts: 23

Re: put jar program in panel

If you want to put directory full of files or launcher of any program from anywhere in the computer (including java) - use menulibre - menu editor. It would let you choose icon, message, command and location of the folder to work on... very helpfull. You cam change the menu entries and their positions inside the menu...
Good luck.

Offline

#19 2016-06-08 09:04:48

cmcanulty
Member
From: Beulah, Michigan
Registered: 2014-05-10
Posts: 260

Re: put jar program in panel

cmcanulty@ubuntu1:~$ ls -l /home/cmcanulty/minecraftedu
total 2652
drwxrwxrwx  2 cmcanulty cmcanulty    4096 Jun  6 07:33 backups
drwxrwxrwx  2 cmcanulty cmcanulty    4096 Jun  6 10:26 debug
-rw-rw-rw-  1 cmcanulty cmcanulty 2678053 Jun  6 07:33 Launcher.jar
drwxrwxrwx  6 cmcanulty cmcanulty    4096 May 20 09:55 launcher_res
drwxrwxrwx  2 cmcanulty cmcanulty    4096 May 20 09:55 lib
drwxrwxrwx 15 cmcanulty cmcanulty    4096 May 20 09:58 minecraft
drwxrwxrwx  4 cmcanulty cmcanulty    4096 May 20 09:56 servertool
-rw-rw-rw-  1 cmcanulty cmcanulty   12245 Jun  6 07:33 startlauncher.jar
cmcanulty@ubuntu1:~$ ls -l /home/cmcanulty/minecraftedu
total 2652
drwxrwxrwx  2 cmcanulty cmcanulty    4096 Jun  6 07:33 backups
drwxrwxrwx  2 cmcanulty cmcanulty    4096 Jun  6 10:26 debug
-rw-rw-rw-  1 cmcanulty cmcanulty 2678053 Jun  6 07:33 Launcher.jar
drwxrwxrwx  6 cmcanulty cmcanulty    4096 May 20 09:55 launcher_res
drwxrwxrwx  2 cmcanulty cmcanulty    4096 May 20 09:55 lib
drwxrwxrwx 15 cmcanulty cmcanulty    4096 May 20 09:58 minecraft
drwxrwxrwx  4 cmcanulty cmcanulty    4096 May 20 09:56 servertool
-rw-rw-rw-  1 cmcanulty cmcanulty   12245 Jun  6 07:33 startlauncher.jar
cmcanulty@ubuntu1:~$

also here are my desktop contents

cmcanulty@ubuntu1:~$ ls Desktop
1.png  Arctic Climate Class  Conviction.desktop            Minecraftedu.desktop
2.png  Chair                 Home _ Linux Journey.desktop
3.png  CNN.desktop           Improvisor0.desktop
cmcanulty@ubuntu1:~$

and here is the minecraft.edu desktop file

[Desktop Entry]
Version=1.0
Type=Application
Name=Minecraftedu
GenericName=Minecraft
Comment=Multiplayer game
Icon=/home/cmcanulty/Documents/Minecraftedulauncher.png
Exec=java -jar  /home/cmcanulty/minecraftedu/Launcher.jar
NoDisplay=false
Categories=Game;
StartupNotify=false
Terminal=false
Name[en_CA]=minecraftedu

Offline

#20 2016-06-08 15:01:17

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,000

Re: put jar program in panel

Everything looks fine there. What happens when you try the following:

exo-open ~/Desktop/Minecraftedu.desktop

Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#21 2016-06-08 22:58:18

cmcanulty
Member
From: Beulah, Michigan
Registered: 2014-05-10
Posts: 260

Re: put jar program in panel

The launcher and start box open but not the game box. Here is the terminal output, sorry I was in the hospital all day

cmcanulty@ubuntu1:~$ exo-open ~/Desktop/Minecraftedu.desktop
cmcanulty@ubuntu1:~$ DEBUG:/home/cmcanulty/debug/launcher.log
PATH: /home/cmcanulty/minecraft/mods/1.7.10
MODS LENGTH: 0
java.io.FileNotFoundException: /home/cmcanulty/debug/launcher.log (Permission denied)
    at java.io.FileOutputStream.open0(Native Method)
    at java.io.FileOutputStream.open(FileOutputStream.java:270)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:162)
    at launcher.a.b.a(Unknown Source)
    at launcher.a.b.<init>(Unknown Source)
    at launcher.a.b.l(Unknown Source)
    at launcher.main.main(Unknown Source)
Appended setting: worldsusername= to file: /home/cmcanulty/launcher_res/settings/launchersettings.ini
Appended setting: keep-mini-launcher-running=false to file: /home/cmcanulty/launcher_res/settings/launchersettings.ini
Appended setting: worldspassword= to file: /home/cmcanulty/launcher_res/settings/launchersettings.ini
Appended setting: rememberworldspassword=false to file: /home/cmcanulty/launcher_res/settings/launchersettings.ini
Appended setting: enable-test-translations=false to file: /home/cmcanulty/launcher_res/settings/launchersettings.ini
java.io.FileNotFoundException: /home/cmcanulty/launcher_res/settings/launchersettings.ini (Permission denied)
    at java.io.FileOutputStream.open0(Native Method)
    at java.io.FileOutputStream.open(FileOutputStream.java:270)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:101)
    at java.io.FileWriter.<init>(FileWriter.java:63)
    at mcedu.global.h.b.a(Unknown Source)
    at mcedu.global.h.a.h(Unknown Source)
    at mcedu.global.h.a.<init>(Unknown Source)
    at launcher.a.a.<init>(Unknown Source)
    at launcher.a.b.<init>(Unknown Source)
    at launcher.a.b.l(Unknown Source)
    at launcher.main.main(Unknown Source)
Loaded empty language from file, returning default!
Launcher 1.2.1 (through bootstrap 4) started on linux...
Current time is Jun 8, 2016 6:53:32 PM
System.getProperty('os.name') == 'Linux'
System.getProperty('os.version') == '4.4.0-22-generic'
System.getProperty('os.arch') == 'amd64'
System.getProperty('java.version') == '1.8.0_91'
System.getProperty('java.vendor') == 'Oracle Corporation'
System.getProperty('sun.arch.data.model') == '64'
Loaded 0 profile(s); selected '(Default)'
Loaded 0 profile(s); selected '(Default)'
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
    at launcher.GUI.GUIMCLauncher.a_(Unknown Source)
    at launcher.GUI.GUIMCLauncher.l(Unknown Source)
    at launcher.GUI.k.actionPerformed(Unknown Source)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
    at java.awt.Component.processMouseEvent(Component.java:6535)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
    at java.awt.Component.processEvent(Component.java:6300)
    at java.awt.Container.processEvent(Container.java:2236)
    at java.awt.Component.dispatchEventImpl(Component.java:4891)
    at java.awt.Container.dispatchEventImpl(Container.java:2294)
    at java.awt.Component.dispatchEvent(Component.java:4713)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
    at java.awt.Container.dispatchEventImpl(Container.java:2280)
    at java.awt.Window.dispatchEventImpl(Window.java:2750)
    at java.awt.Component.dispatchEvent(Component.java:4713)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
    at java.awt.EventQueue.access$500(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.awt.EventQueue$3.run(EventQueue.java:703)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
    at java.awt.EventQueue$4.run(EventQueue.java:731)
    at java.awt.EventQueue$4.run(EventQueue.java:729)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

Offline

#22 2016-06-09 00:03:41

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,000

Re: put jar program in panel

cmcanulty wrote:

java.io.FileNotFoundException: /home/cmcanulty/debug/launcher.log (Permission denied)
...
java.io.FileNotFoundException: /home/cmcanulty/launcher_res/settings/launchersettings.ini (Permission denied)

This is strange. Its not finding these directories because its not using the correct path (it should be looking in the minecraftedu folder, not your home folder). I don't know why its doing this and I can't have a closer look because this program is a purchased program, but I would suggest creating a starter script and using it.

Create the file ~/bin/start_minecraftedu (create the ~/bin directory if it doesn't exist) with the following content:

#!/bin/bash

cd /home/cmcanulty/minecraftedu
java -jar Launcher.jar

...and make the file executable.

Then try running it manually to make sure it works:

~/bin/start_minecraftedu

If all is fine, in your minecraftedu.desktop file on your desktop, change the line:

Exec=java -jar  /home/cmcanulty/minecraftedu/Launcher.jar

...to read:

Exec=/home/cmcanulty/bin/start_minecraftedu

Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#23 2016-06-12 14:07:43

cmcanulty
Member
From: Beulah, Michigan
Registered: 2014-05-10
Posts: 260

Re: put jar program in panel

OK I finally did some tweaks. I added the working directory to the launcher. Then the launcher opens the first box, the second launch box and the black game box but before it loads the white box and game it crashes every time. The I did your bin tweak and made it executable and the same crashing behavior occurs. This seems so strange that making a simple desktop launcher can be so difficult with no real solution. I have gotten the launcher to work on my home desktop also running xubuntu 16.04 using these commands:
Name: minecraftedu
Working Directory: java -jar  /home/cmcanulty/minecraftedu/Launcher.jar
Command: /home/cmcanulty/minecraftedu/

However I can't get it to work with the identical command on any of the library computers (except the name changed to librarian or darcy) it has the above crashing behavior. Now I am going through all the installed java items in my synaptic and making sure the library machines have the exact list but there are hundreds and it will take forever.

Last edited by cmcanulty (2016-06-12 15:22:41)

Offline

Board footer

Powered by FluxBB