Reputation: 609
I have one java project. I have to RUN on .bat before running the project. I am unable to understand or read its working structure. As I open it in TextEditor, it shows text as below
@ECHO OFF
set bin=./bin
set classes=%bin%/cadel.jar;%bin%/clinkx.jar;%bin%/clink170b_ns.jar;%bin%/ns.jar
set main=org.itolab.morihit.cadel2.Cadel2
set rule=data/default
start /min "cadel" java -classpath %classes% %main% %rule%
It looks similar to me, but I cannot understand it completely.
How it is using "set" and why is it necessary to run my java project through bat file?
Upvotes: 0
Views: 38
Reputation: 312259
set
is the way .bat files define environment variables - here, in order to set up the classpath, the main class, etc.
It is not strictly required to run a java project via a .bat file, but considering the length of the command line required to run it (java -classpath ... org.package.MainClass arg1 arg2 etc.
), it is simply more convenient.
Upvotes: 2
Reputation: 2881
It is not mandatory. Set is used to define variables. It improves readibility, maintainance and reuse.
Upvotes: 0