Pinned topic run java program using bat file
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
I want to run a simple hello world java (HelloWorld.java) program using a batch file. How can i run it and how to construct a batch file. kindly let me know
Updated on 2011-01-15T03:51:54Z at 2011-01-15T03:51:54Z by JavinPaul
SystemAdmin 110000D4XK210 Posts
Re: run java program using bat file2010-12-27T23:20:47ZThis is the accepted answer. This is the accepted answer.Invoking java class from bat file is simple.
Do you have basic knowledge on DOS/Windows batch file ?
In your batch file specify the following commands
1. add jdk bin folder to your PATH
2. javac <your javafile>
3. java <your class file generated from step 2>
save this file as *.bat and execute it. if you are using any specify libraries then add it in classpath
JavinPaul 270003U66V1 Post
Re: run java program using bat file2011-01-15T03:51:54ZThis is the accepted answer. This is the accepted answer.Hi,
Batch file (.bat) is nothing but a text file with .bat extension and generally we store commands on it (like shell script in unix) and when we invoke it from command prompt , DOS execute those commands. so by putting "java classname" in batch file you can invoke your program but yes its good idea to set PATH and CLASSPATH inside batch file for convinience.
Why String is immutable in Java FIX Protocol tutorial tibco tutorial