Creating Bat file in LInux
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Sujith_Varghese
Posted On:   Saturday, October 18, 2003 12:17 AM

hi



Could you please tell me how can i create a file same as bat file in Windows. My main problem is i developed a Java project and thats running in windows using a bat file. but i cant run that same project in Linux using double click.

How can i do that..


Thanks in advance
Sujith varghese

Re: Creating Bat file in LInux

Posted By:   Todd_Stout  
Posted On:   Wednesday, December 17, 2003 06:24 AM

Another alternative is to create an executable
jar by specifying a manifest when you create the
jar. By doing this you do not have to write
a script to execute the java program.
You simply execute 'java -jar yourjar.jar'.
In addition, the manifest lets you specify
any jars that the jar is dependent on at
runtime. This allows you to not have to
be concerned with setting the CLASSPATH
environment variable. This works for all
platforms.

Re: Creating Bat file in LInux

Posted By:   Stephen_McConnell  
Posted On:   Saturday, October 18, 2003 11:12 AM

Instead of a .bat file in Linux, you usually create a .sh file; and write a shell script in "bash" or "korn" or "perl" or "php"... depending upon what your command shell is or what scripting languages are installed on your computer.


Make sure to give that file execute permissions when it is installed.


There are TONS of examples of these shell scripts on your Linux installation. Just like you had to learn the DOS scripting language, you should learn "bash" (it's becoming the standard installation shell on Linux). It's not hard; and opens up a whole new world.


Another scripting language usually installed on Linux is Perl. I'm having to learn that right now because my shop is heavy into Perl Scripts.... It is the "swiss army knife" of languages...


Good Luck


Stephen McConnell

About | Sitemap | Contact