LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 12-20-2005, 10:44 PM   #1
merchtemeagle
Member
 
Registered: Oct 2004
Location: Belgium
Distribution: Slackware 13.37
Posts: 512

Rep: Reputation: 31
Starting Java applications


I've downloaded some applications written in Java, and I want to make Slackware packages for them. But I want to be able to run a program by just supplying a name on the commandline.
For example:

$jpiccola

instead of having to do:

$java -jar JPiccola.jar

or

$java bla/bla/bla/ClassWithMain

What would be the easiest way to accomplish this? I was thinking of putting a script with aliases in /etc/profile.d for every application.
 
Old 12-21-2005, 12:25 AM   #2
gbonvehi
Senior Member
 
Registered: Jun 2004
Location: Argentina (SR, LP)
Distribution: Slackware
Posts: 3,145

Rep: Reputation: 51
If you want to package them the best approach would be to create a simple bash script that installs to /usr/bin with a content like:
Code:
#!/bin/sh
cd /path/to/program
java -jar program.jar
 
Old 12-21-2005, 05:48 AM   #3
jayakrishnan
Member
 
Registered: Feb 2002
Location: India
Distribution: Slacky 12.1, XP
Posts: 992

Rep: Reputation: 30
small change in the above code

#!/bin/sh
cd /path/to/program
java -jar $1

run the script as 'sh <scriptname> <jar file name>'
 
Old 12-21-2005, 12:49 PM   #4
merchtemeagle
Member
 
Registered: Oct 2004
Location: Belgium
Distribution: Slackware 13.37
Posts: 512

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by jayakrishnan
small change in the above code

#!/bin/sh
cd /path/to/program
java -jar $1

run the script as 'sh <scriptname> <jar file name>'
That would be only shifting the call from

$java -jar jarname

to

$sh scriptname jarname
 
  


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
Applications not starting pconrad Fedora 2 10-04-2004 01:43 AM
Starting applications at login in GNOME janisj Linux - Software 1 08-07-2004 06:40 AM
starting applications corbis_demon Linux - Newbie 3 06-28-2004 03:19 AM
starting applications at boot time jogurt666 Debian 4 01-21-2004 03:39 AM
Booting and starting applications really slow maenho Linux - Newbie 2 11-04-2003 01:37 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 05:24 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration