To write a batch processing script which runs on bash

view story

http://askubuntu.com – How to convert your java program so that it runs as a batch program i.e it can be run like a command in the ubuntu or any linux machine. What is the procedure and what are the steps to follow? Specifically java program. C program is also fine. I want to know if any libraries to be added to the java/c program and also where to place the program and how to write a man page. (HowTos)