954,525 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Start a .jar file from a shell script

I attempted to make a shell script to launch a java program packaged into a .jar file. It should have been pretty simple.

#!/bin/sh
java -jar Test.jar


but for some reason this script never runs. i've manually executed the command and it works perfectly, i've checked the path of the JVM and nothing is wrong. What have i missed? can anyone help?

Digitalwolf
Newbie Poster
9 posts since Aug 2011
Reputation Points: 10
Solved Threads: 0
 

That's interesting!

If you can run that from the command line, it *should* work in a script as well... Perhaps try using the full path to 'java' and the full path to the Test.jar?

Gromit
Posting Whiz in Training
212 posts since Sep 2008
Reputation Points: 47
Solved Threads: 31
 

yes that did the trick :), what i did was,

cd directorypath;java -jar Test.jar;
Digitalwolf
Newbie Poster
9 posts since Aug 2011
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You