This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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: 24183
    
  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: 41032
    
  43
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.......
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Calling a java program(main method ) from a shell script
 
Similar Threads
Running a Java Class from a Unix Shell Script
running java program from a shell script
Callling a Script from a java program
How to call Java program main method from shell script
ftp files to a different server