Results 1 to 4 of 4
- 01-04-2014, 09:32 PM #1
Senior Member
- Join Date
- Aug 2011
- Posts
- 118
- Rep Power
- 0
Multiple exevution of Jar file with from JAVA Code
Hello my friend,
I would like to ask you how can i execute the next code without errors.
I am trying to execute a jar (myFile.jar) file multiple times with different inputs from another jar file. More simple i have game with many players and i create a Round Robin scheduling for the tournament, i need to execute all the mach's of a round together.
When i run the next code it execute on the first game with the first players multiple times.
Any idea ???
Java Code:public class RunJARFile { //10 player //5 game per round public static void main(String[] args) throws IOException { for (int Tour = 0; Tour < 9 ; Tour++) { for (int Game = 0; Game < 5; Game++) { player1 = Scheduling.player1Table[Tour][Game]; player2 = Scheduling.player2Table[Tour][Game]; logFile = "logfile"+Tour+"-"+Game+".log"; Runtime.getRuntime().exec("cmd /c java -jar myFile.jar "+player1+" "+player2+" "+Path+" "+Pmch+" >> "+logFile+" 2>&1"); } } } }
- 01-05-2014, 03:36 AM #2
▼ dafuq did I do?
- Join Date
- Dec 2013
- Posts
- 204
- Rep Power
- 0
- 01-05-2014, 11:31 AM #3
Senior Member
- Join Date
- Aug 2011
- Posts
- 118
- Rep Power
- 0
Re: Multiple exevution of Jar file with from JAVA Code
Do you have any example of batch file execution ?
- 01-05-2014, 12:42 PM #4
▼ dafuq did I do?
- Join Date
- Dec 2013
- Posts
- 204
- Rep Power
- 0
Similar Threads
-
HELP! How to write simple code for multiple choice quizz with java!
By Spinz in forum New To JavaReplies: 5Last Post: 07-09-2013, 04:06 PM -
Need a java code to read 2-dimensional excel file and write as 1-dimensional file
By idhayanila in forum New To JavaReplies: 2Last Post: 03-12-2013, 11:17 AM -
how to use -d to compile java code to separate class and java file
By Tarasj in forum New To JavaReplies: 5Last Post: 03-26-2012, 08:11 PM -
how to run java file with multiple java libarary using cmd
By Jhovarie in forum Other IDEsReplies: 5Last Post: 07-17-2011, 01:50 AM -
multiple java files with single connection code
By hitesh in forum Advanced JavaReplies: 7Last Post: 11-23-2010, 09:18 AM
Bookmarks