User Tools

Site Tools


java_class_process

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
java_class_process [2013/04/29 08:29]
yann
java_class_process [2013/04/29 08:32]
yann
Line 5: Line 5:
 The Java class Process is used together with class Runtime. As explained by Oracle: "The Runtime.exec methods create a native process and return an instance of a subclass of Process that can be used to control the process and obtain information about it. The class Process provides methods for performing input from the process, performing output to the process, waiting for the process to complete, checking the exit status of the process, and destroying (killing) the process."​ (from the [[http://​docs.oracle.com/​javase/​1.4.2/​docs/​api/​java/​lang/​Process.html|Javadocs of version 1.4.2]]). The Java class Process is used together with class Runtime. As explained by Oracle: "The Runtime.exec methods create a native process and return an instance of a subclass of Process that can be used to control the process and obtain information about it. The class Process provides methods for performing input from the process, performing output to the process, waiting for the process to complete, checking the exit status of the process, and destroying (killing) the process."​ (from the [[http://​docs.oracle.com/​javase/​1.4.2/​docs/​api/​java/​lang/​Process.html|Javadocs of version 1.4.2]]).
  
-Typically, in [[MoDeC]], we created and run a Process that executes a new Java virtual machine, which itself runs a program whose bytecodes we had instrumented to collect traces. Simply put:+Typically, in [[MoDeC]], we created and ran a Process that executes a new Java virtual machine, which itself runs a program whose bytecodes we had instrumented to collect traces. Simply put:
  
 <​code>​ <​code>​
-String commandLine = ...; +final String commandLine = ...; 
-String ​absolutePathToInstrumentedFiles = ...;+final File   absolutePathToInstrumentedFiles = ...;
  
 final Process process = final Process process =
Line 21: Line 21:
   * commandLine is the complete command line to run a new Java virtual machine;   * commandLine is the complete command line to run a new Java virtual machine;
   * new string[0] tells the Runime.exec() that we do not touch the environment;​   * new string[0] tells the Runime.exec() that we do not touch the environment;​
-  * absolutePathToInstrumentedFiles is the complete, absolute path to the root directory containing the instrumented bytecodes.+  * absolutePathToInstrumentedFiles is a File pointing on the root directory containing the instrumented bytecodes.
  
 ===== The Bug ===== ===== The Bug =====
  
-When applying [[MoDeC]] on "​small" ​program, we did not encounter any problem, neither on Windows nor on Mac OS. However, when Soumaya ran [[MoDeC]] on the instrumented version of ArgoUML v0.19.8, ​should ​got this exception (here reproduced using Venera'​s Mac):+When applying [[MoDeC]] on "​small" ​programs, we did not encounter any problem, neither on Windows nor on MacOS. However, when Soumaya ran [[MoDeC]] on the instrumented version of ArgoUML v0.19.8, ​she got this exception (here reproduced using Venera'​s Mac):
  
 <​code>​ <​code>​
Line 38: Line 38:
 </​code>​ </​code>​
  
-which was very puzzling because the version of [[MoDeC]] and the same input file and the same instrumented bytecodes would work on Yann's Windows laptop and produce the expected traces.+which was very puzzlingbecause the //​same// ​version of [[MoDeC]] and the //same// input file and the //same// instrumented bytecodes would work on Yann's Windows laptop and produce the expected traces.
  
 ===== The Solution ===== ===== The Solution =====
java_class_process.txt · Last modified: 2019/10/06 20:37 (external edit)