LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 06-27-2010, 01:39 AM   #1
ratilio
Member
 
Registered: Mar 2007
Posts: 31

Rep: Reputation: 15
How to create a launcher for a Java application


Ok I just downloaded this program called Phex, it is a really cool program and i get it to run, but only from command line. I downloaded this program and its already compiled and works fine but i can only launch it from a command line by typing "java -jar phex.jar"
I have created launchers before and they have worked, but this one just doesn't work. I have all permissions on the directory and the files, but how to create a launcher for this file. Can anyone help me?
 
Old 06-27-2010, 02:52 AM   #2
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 248Reputation: 248Reputation: 248
Give the full path to phex.jar in the command, or create a script containing the command (with full path) and launch that instead.
 
Old 06-27-2010, 05:55 PM   #3
ratilio
Member
 
Registered: Mar 2007
Posts: 31

Original Poster
Rep: Reputation: 15
Thanks for this, I will give it a try and see if it works
 
Old 06-27-2010, 06:30 PM   #4
ratilio
Member
 
Registered: Mar 2007
Posts: 31

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by smoker View Post
Give the full path to phex.jar in the command, or create a script containing the command (with full path) and launch that instead.
I was not able to create the script. Can you tell me how would you do it?
 
Old 06-27-2010, 07:20 PM   #5
ratilio
Member
 
Registered: Mar 2007
Posts: 31

Original Poster
Rep: Reputation: 15
Ok I created a text file with the command "java -jar /usr/local/Phex/phex.jar" and gave it executable permissions and it works now. But the only thing is that when I double click it to start it it asks me "Do you want to run Phex? or display its contents?" "Phex" is an executable text file" and then it gives me the options "run in terminal" "display" "cancel" "run". If I click "run in terminal" the terminal opens, the program is executed and the program runs, but I need to have the terminal open while the program runs. If I click "display" it doesn't run, and if I click run it runs fine, but I want it to start just by double clicking on it without it asking me this question all the time. Do you know how can I do this?
 
Old 06-29-2010, 06:55 AM   #6
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014.08, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 14,112

Rep: Reputation: 2639Reputation: 2639Reputation: 2639Reputation: 2639Reputation: 2639Reputation: 2639Reputation: 2639Reputation: 2639Reputation: 2639Reputation: 2639Reputation: 2639
The usual way to use such a "jar starter script" :

Copy the script to /usr/local/bin/

And create a launcher / "Icon" / "Phex.desktop" file
that has : Exec=script-name.

That works !
..
 
Old 06-30-2010, 03:49 AM   #7
ratilio
Member
 
Registered: Mar 2007
Posts: 31

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by knudfl View Post
The usual way to use such a "jar starter script" :

Copy the script to /usr/local/bin/

And create a launcher / "Icon" / "Phex.desktop" file
that has : Exec=script-name.

That works !
..

Hey thanks for replying, I thought nobody was going to reply again, I will give it a try and see what happens.
 
Old 06-30-2010, 04:46 AM   #8
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014.08, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 14,112

Rep: Reputation: 2639Reputation: 2639Reputation: 2639Reputation: 2639Reputation: 2639Reputation: 2639Reputation: 2639Reputation: 2639Reputation: 2639Reputation: 2639Reputation: 2639
Quote:
I thought nobody was going to reply again
Well, may be you would have found the solution yourself.
( A command / solution is easier to remember, when you
"invent" it yourself.) ..
So that's a good reason to hold back an answer for a day or two.

Also : It has been answered before,
you might eventually have found this :
http://www.linuxquestions.org/questions/search.php
LQ Search → 'Tag Name' = java+jar
..

Last edited by knudfl; 06-30-2010 at 04:47 AM.
 
Old 06-30-2010, 04:59 PM   #9
ratilio
Member
 
Registered: Mar 2007
Posts: 31

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by knudfl View Post
Well, may be you would have found the solution yourself.
( A command / solution is easier to remember, when you
"invent" it yourself.) ..
So that's a good reason to hold back an answer for a day or two.

Also : It has been answered before,
you might eventually have found this :
http://www.linuxquestions.org/questions/search.php
LQ Search → 'Tag Name' = java+jar
..
I was not able to do it, so I am going to just keep the current launcher I created even if it always asks me those 3 questions. Thanks for your help though
 
  


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
how can I create dual application launcher ameyjah Linux - Software 4 04-23-2008 06:12 AM
Creating a launcher (could be java launcher) The_Messiah Linux - Newbie 12 04-06-2005 02:36 AM
How to create a menu group and application launcher? kiranprashant Programming 5 02-26-2005 01:15 AM
How do I create application launcher using bash script msgclb Programming 2 01-30-2005 07:28 AM
Application Launcher jamoraqui Linux - Newbie 9 08-23-2004 07:23 AM


All times are GMT -5. The time now is 05:57 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration