Good Day Everyone, I have a program (lets call it ‘A’), which is called from an ANT script using java. This program uses Runtime.getRunTime.exec("batFile.bat"). The .bat file in-turn calls another java file (lets call it ‘B’). Now, here comes the problem.
Is there a way in which B can access instance variable of A ?
If you know the value of the variable in process A before it launches process B, then you could share that value in a number of ways.
Pass it as a command line argument, e.g.:
Set it as variable in the environment of B’s process, e.g.:
Write the value to a file in process A, read the file in process B.