The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 10-03-2007
umen umen is offline
Registered User
  
 

Join Date: Aug 2005
Posts: 239
how cat i run jar from sh

Hello all
im trying to start jar with sh script
i have foo.jar
and i have this sh that does not work ...

PHP Code:
#!/bin/sh
exec java -cp .;foo.jar com.umen.Main 
what im doing wrong here ?
  #2 (permalink)  
Old 10-03-2007
blowtorch's Avatar
blowtorch blowtorch is offline Forum Advisor  
Supporter
  
 

Join Date: Dec 2004
Location: Singapore
Posts: 2,350
Are you sure about that ".;"? Should it perhaps be "./"?
  #3 (permalink)  
Old 10-03-2007
umen umen is offline
Registered User
  
 

Join Date: Aug 2005
Posts: 239
its does not help
im getting this error :
./foo.jar: ./foo.jar: cannot execute binary file
  #4 (permalink)  
Old 10-03-2007
sysgate's Avatar
sysgate sysgate is offline Forum Advisor  
Unix based
  
 

Join Date: Nov 2006
Location: Bulgaria
Posts: 1,322
why do you need exec ? You can just do :
Code:
#!/bin/sh
java -jar path-to-jar
  #5 (permalink)  
Old 10-03-2007
umen umen is offline
Registered User
  
 

Join Date: Aug 2005
Posts: 239
i need to tell java about class path in my case the local place that is ->"."
im reading from there configuration files . so i can't run only the jar
even when i do without the sh
java -cp /.;foo.jar com.umen.Main
or
java -cp .;foo.jar com.umen.Main
im still getting the error :
./foo.jar: ./foo.jar: cannot execute binary file

but when i do :
java -cp foo.jar com.umen.Main (without the ".")
its working , but my java app failed Because it is looking for the configurations files from "."
so why i can't add the "." to -cp ?
  #6 (permalink)  
Old 10-03-2007
tomas's Avatar
tomas tomas is offline
Registered User
  
 

Join Date: Sep 2007
Posts: 35
do you have the configuration file in the same directory as the jar? If so does the jar have a hard coded path of where the configuration file needs to be stored?
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate 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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 03:42 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0