How to call Java classes/Methods from shell

Please support our Shell Scripting advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Jun 2006
Posts: 3
Reputation: girish.sh is an unknown quantity at this point 
Solved Threads: 0
girish.sh girish.sh is offline Offline
Newbie Poster

How to call Java classes/Methods from shell

 
0
  #1
Jun 23rd, 2006
Hi all,

I am a new joinee in this forum. I am facing one problem.

How to call Java classes and methods from shell scripts?? i am using KSH.

Is it really possible to do that or not?

Response will be appreciated.

Thanks,
Girish Sharma
Reply With Quote Quick reply to this message  
Join Date: Feb 2006
Posts: 2,432
Reputation: masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of 
Solved Threads: 258
Moderator
masijade's Avatar
masijade masijade is online now Online
Nearly a Posting Maven

Re: How to call Java classes/Methods from shell

 
0
  #2
Jun 23rd, 2006
The only java method you can call from a shell script is the main method
of a class, by starting that class with a java command line execution.
Java Programmer and Sun Systems Administrator

----------------------------------------------

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
Reply With Quote Quick reply to this message  
Join Date: Jun 2006
Posts: 3
Reputation: girish.sh is an unknown quantity at this point 
Solved Threads: 0
girish.sh girish.sh is offline Offline
Newbie Poster

Shell Script exit status

 
0
  #3
Jun 23rd, 2006
Can we define exit status intereger values for our purpose except 0?

like can i set custom exit status messages:

"1" for error occured because of reason #1
"2" for error occured because of reason #2
...

Is there any document which displays all the exit status code values from 0-255?
Reply With Quote Quick reply to this message  
Join Date: Feb 2006
Posts: 2,432
Reputation: masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of 
Solved Threads: 258
Moderator
masijade's Avatar
masijade masijade is online now Online
Nearly a Posting Maven

Re: Shell Script exit status

 
0
  #4
Jun 23rd, 2006
Your exit status from your java program is whatever number you place
in the System.exit call. There is no standard exit code value other than
0 is successful and not 0 is an error. I would say you are probably pretty
safe using return codes between 50 and 200, just a personal guess. I
have never actually seen the jvm die with an error code other than 0, 1,
254, or 255.
Java Programmer and Sun Systems Administrator

----------------------------------------------

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC