Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to create a batch file for a java program?

 
Ong CherYee
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a java project in JCreator and the project is organised into packages. I have also configured JCreator to provide 2 arguments to the main method when the project is executed.

I would want to create a batch file (.bat) for this project where the batch file can automatically use the arguments set in JCreator when the program runs.

How do I go about creating the batch file?
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Pie
Posts: 15441
41
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A Windows batch file is simply a text file with commands. You can create it with any text editor (for example, Notepad if you don't have anything better). Create a new file with the extension .bat and put commands in it that you want to execute when the batch file is run.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic