LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-15-2008, 04:58 PM   #1
dauphinfay
Member
 
Registered: Jan 2004
Location: Earth
Distribution: Ubuntu
Posts: 301

Rep: Reputation: 30
Jin Chess Client can't create menu shortcut


This is new to me as I have always been able to add commands that launch an application to the main menu. However, with the Jin Chess Client I have to have a custom command in order to launch it

/home/user/jin-2.14.1$ java -jar jin.jar

This works in the command line but I cannot get it to work from the custom command option in the main menu. There is no clickable option to get this application working. I have to use the cli. There has got to be something special that I am missing. Apparently, I have to be in the directory or I get an error. Here is the output I get for the mistake:


$ /home/user/jin-2.14.1/java -jar jin.jar
bash: /home/user/jin-2.14.1/java: No such file or directory


Any suggestions?

Last edited by dauphinfay; 12-15-2008 at 05:03 PM.
 
Old 12-15-2008, 05:10 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Try '/path/to/java -jar /home/user/jin-2.14.1/jin.jar' where "/path/to" is the output of `which java` (usually /usr/bin).

[EDIT]
BTW, I don't know where .*buntu keeps its .desktop files ("locate -r /usr/share/.*/*.desktop$" or "find /usr/share/ -type f -iname \*.desktop") but you could try dropping a file named "jinchessclient.desktop" in one of them dirs and see if it pops up next time your desktop environment rereads those dirs:
Code:
[Desktop Entry]
Encoding=UTF-8
Exec=/usr/bin/java -jar /home/user/jin-2.14.1/jin.jar
Icon=
DocPath=
Path= 
Type=Application
Terminal=false
Name=Jin Chess Client
X-KDE-StartupNotify=true
Categories=Games;
* Note this doesn't conform to any standards, I just wanted to only write the basic entries.

Last edited by unSpawn; 12-15-2008 at 05:20 PM. Reason: .desktop file example
 
Old 12-15-2008, 06:00 PM   #3
dauphinfay
Member
 
Registered: Jan 2004
Location: Earth
Distribution: Ubuntu
Posts: 301

Original Poster
Rep: Reputation: 30
Almost there. I followed the first suggestion and the error says that it can't find java.io. It goes on to say that it can't find the directory "/home/user/libs". It then says that I am most likely not running Jin from its directory. I'm getting close but this is odd as I checked the path "/home/user/jin-2.14.1 is correct.

Thanks for your patience unSpawn.
 
Old 12-16-2008, 12:56 PM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by dauphinfay View Post
It goes on to say that it can't find the directory "/home/user/libs".
Maybe the software wasn't installed properly?


Quote:
Originally Posted by dauphinfay View Post
It then says that I am most likely not running Jin from its directory.
Try 'cd /home/user/jin-2.14.1/ && /usr/bin/java -jar ./jin.jar' and please post exact error messages, TIA.
 
Old 12-17-2008, 08:29 AM   #5
dauphinfay
Member
 
Registered: Jan 2004
Location: Earth
Distribution: Ubuntu
Posts: 301

Original Poster
Rep: Reputation: 30
Could not launch menu item
Failed to execute child process "cd" (no such file or directory)



That is the output. It's rubbish though as I have checked, double checked and triple checked. The directory is correct. it is /home/user/jin-2.14.1/


thanks once again.
 
Old 12-17-2008, 12:45 PM   #6
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Trying to prefix full paths on everything should work but the .desktop file might not like the "&&" part. To work around that create a shellscript with contents [code]
#!/bin/sh --
cd /home/user/jin-2.14.1 || exit 127
exec /usr/bin/java -jar ./jin.jar
exit 0
[code]
and save it as "/usr/local/bin/jin", then make it executable with 'chmod 0755 /usr/local/bin/jin' and change the Exec= line in the .desktop file to read "Exec=/usr/local/bin/jin".
 
Old 12-22-2008, 08:56 AM   #7
dauphinfay
Member
 
Registered: Jan 2004
Location: Earth
Distribution: Ubuntu
Posts: 301

Original Poster
Rep: Reputation: 30
I could not get the above to work. I am sure it is my fault though. With that said, I had rebooted and not for some reason I can simply add the executable (that was not working initially without the "jar" addition).

Hopefully, the above info will help the next fellow that comes around. Thanks again.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
command to create shortcut for an application in the start menu for linux neerajchaudhari Linux - Software 1 08-29-2005 03:11 AM
Jin Chess for Suse 9.3 aquatux SUSE / openSUSE 1 07-15-2005 08:11 PM
Firefox shortcut on menu houmie SUSE / openSUSE 7 04-21-2005 08:30 PM
How do i add a shortcut to my menu? Braveheart1980 Linux - General 1 03-07-2004 10:09 PM
msn zone chess client frankprogramer Linux - Software 1 10-27-2002 01:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:51 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration