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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
06-27-2010, 12:39 AM
|
#1
|
|
Member
Registered: Mar 2007
Posts: 31
Rep:
|
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?
|
|
|
|
06-27-2010, 01:52 AM
|
#2
|
|
Senior Member
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279
|
Give the full path to phex.jar in the command, or create a script containing the command (with full path) and launch that instead.
|
|
|
|
06-27-2010, 04:55 PM
|
#3
|
|
Member
Registered: Mar 2007
Posts: 31
Original Poster
Rep:
|
Thanks for this, I will give it a try and see if it works
|
|
|
|
06-27-2010, 05:30 PM
|
#4
|
|
Member
Registered: Mar 2007
Posts: 31
Original Poster
Rep:
|
Quote:
Originally Posted by smoker
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?
|
|
|
|
06-27-2010, 06:20 PM
|
#5
|
|
Member
Registered: Mar 2007
Posts: 31
Original Poster
Rep:
|
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?
|
|
|
|
06-29-2010, 05:55 AM
|
#6
|
|
LQ 5k Club
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2012.8, Slack1337 DebSqueeze, +50+ other Linux OS, for test only.
Posts: 11,624
|
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 !
..
|
|
|
|
06-30-2010, 02:49 AM
|
#7
|
|
Member
Registered: Mar 2007
Posts: 31
Original Poster
Rep:
|
Quote:
Originally Posted by knudfl
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.
|
|
|
|
06-30-2010, 03:46 AM
|
#8
|
|
LQ 5k Club
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2012.8, Slack1337 DebSqueeze, +50+ other Linux OS, for test only.
Posts: 11,624
|
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 03:47 AM.
|
|
|
|
06-30-2010, 03:59 PM
|
#9
|
|
Member
Registered: Mar 2007
Posts: 31
Original Poster
Rep:
|
Quote:
Originally Posted by knudfl
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
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 07:26 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|