LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
LinkBack Search this Thread
Old 11-16-2009, 11:29 AM   #1
jaydeepnp
LQ Newbie
 
Registered: Nov 2009
Posts: 2

Rep: Reputation: 0
Shell script for jar utility


I have jar utility, I want to create schell script to execute this jar utility and also provide inputs for the jar utility from the shell script is this possiable? How?

Please help

Jaydeep
 
Old 11-16-2009, 11:40 AM   #2
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Slackware 13.1, Debian Squeeze
Posts: 7,058
Blog Entries: 21

Rep: Reputation: 787Reputation: 787Reputation: 787Reputation: 787Reputation: 787Reputation: 787Reputation: 787
You can do it from a shell script exactly the same way you do it from the command line.
 
Old 11-17-2009, 12:34 AM   #3
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2010.12, Slack1337 DebSqueeze, +50+ other Linux OS, for test only.
Posts: 8,581

Rep: Reputation: 1209Reputation: 1209Reputation: 1209Reputation: 1209Reputation: 1209Reputation: 1209Reputation: 1209Reputation: 1209Reputation: 1209
Code:
#!/bin/bash

cd <path-to-file.jar>

exec java -jar <file.jar>
chmod +x start-script.sh
.. and .. 'cp start-script.sh /usr/local/bin/'
.. make a Desktop Entry ( Icon ) to start the application.
.....
 
Old 11-18-2009, 03:37 AM   #4
jaydeepnp
LQ Newbie
 
Registered: Nov 2009
Posts: 2

Original Poster
Rep: Reputation: 0
Thanks Catkin & knudfl for your response.

I am herewith want to rephrase my question.

See I am having jar utility which currently I am running from command prompt. This utility asks for 5 inputs and then does its work after all inputs.

Now I want to create shell script for executing the jar utility and also provide the inputs say by reading data from separate file. Is this possible? how?

Once again thanks a lot for your response.

Jaydeep
 
Old 11-18-2009, 09:11 AM   #5
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Slackware 13.1, Debian Squeeze
Posts: 7,058
Blog Entries: 21

Rep: Reputation: 787Reputation: 787Reputation: 787Reputation: 787Reputation: 787Reputation: 787Reputation: 787
Depending on how the jar utility works it may be possible with a here document (scroll down to sections 3.6.6 and 3.6.7).
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
I got error with this command 'java -jar NodeView-v1.1.jar' mohdismiaswaly Linux - Software 3 04-23-2009 07:24 AM
Permission Issue With Shell Script and .Jar File timmit Slackware 3 06-02-2008 08:33 AM
shell script to use Snort utility Adil_uk Programming 0 12-01-2005 06:59 PM
Fedora Core 1 Associating .jar files with java -jar command pymehta Fedora 0 01-13-2005 06:26 AM


All times are GMT -5. The time now is 06:26 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
Open Source Consulting | Domain Registration