aspose file tools*
The moose likes Linux / UNIX and the fly likes Calling a java program(main method ) from a shell script Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "Calling a java program(main method ) from a shell script" Watch "Calling a java program(main method ) from a shell script" New topic
Author

Calling a java program(main method ) from a shell script

Srivatsan Shyam
Greenhorn

Joined: Feb 11, 2009
Posts: 3
Hi all,

I have a requirement wherein I need to call a java program from the shell script. I am a java developer and have no idea on shell scripting. Can anyone out there please give me the exact code which I can use for my purpose. I request and appreciate any immediate help.

P.S- The shell script will inturn be called from an autosys .jil files.
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

To invoke a Java class, you'd use...

java ClassName

Same as on Windows, if that's what you're used to. Now, all the other stuff around it -- that might be harder!


[Jess in Action][AskingGoodQuestions]
Srivatsan Shyam
Greenhorn

Joined: Feb 11, 2009
Posts: 3
Ernest Friedman-Hill wrote:To invoke a Java class, you'd use...

java ClassName

Same as on Windows, if that's what you're used to. Now, all the other stuff around it -- that might be harder!





HI,

Thanks for the reply. But as I have no idea on shell scripting, I would be really helpful if you give me the exact code I should use.

Thanks in advance
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41904
    
  63
Shell scripting is a useful thing to know, at least the basics of it. Start here: Bash Guide for Beginners


Ping & DNS - my free Android networking tools app
Srivatsan Shyam
Greenhorn

Joined: Feb 11, 2009
Posts: 3
Ulf Dittmer wrote:Shell scripting is a useful thing to know, at least the basics of it. Start here: Bash Guide for Beginners



Thank You.....that site is cool.......
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Calling a java program(main method ) from a shell script