| Both sides previous revisionPrevious revisionNext revision | Previous revision |
| java_class_process [2013/04/29 07:58] – yann | java_class_process [2025/01/15 21:40] (current) – external edit 127.0.0.1 |
|---|
| 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 to execute a program whose bytecodes we had instrumented and collect traces, as follows: | 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> |
| | final String commandLine = ...; |
| | final File absolutePathToInstrumentedFiles = ...; |
| | |
| final Process process = | final Process process = |
| Runtime.getRuntime().exec( | Runtime.getRuntime().exec( |
| </code> | </code> |
| |
| ===== The Bug ===== | where |
| | * 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; |
| | * absolutePathToInstrumentedFiles is a File pointing on the root directory containing the instrumented bytecodes. |
| |
| | ====== The Bug ====== |
| | |
| | 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> |
| | Exception in thread "main" java.lang.NoClassDefFoundError: Invoker/bin:/Users/Neni/Documents/Research/2013-LabalingTraceSegm/eclipseWS/CPL/lib/pdf-transcoder/jar:/Users/Neni/Documents/Research/2013-LabalingTraceSegm/eclipseWS/CPL/lib/batik-anim/jar:/Users/Neni/Documents/Research/2013-LabalingTraceSegm/eclipseWS/CPL/lib/batik-bridge/jar:/Users/Neni/Documents/Research/2013-LabalingTraceSegm/eclipseWS/CPL/lib/batik-codec/jar:/Users/Neni/Documents/Research/2013-LabalingTraceSegm/eclipseWS/CPL/lib/batik-extension/jar:/Users/Neni/Documents/Research/2013-LabalingTraceSegm/eclipseWS/CPL/lib/batik-gui-util/jar:/Users/Neni/Documents/Research/2013-LabalingTraceSegm/eclipseWS/CPL/lib/batik-gvt/jar:/Users/Neni/Documents/Research/2013-LabalingTraceSegm/eclipseWS/CPL/lib/batik-script/jar:/Users/Neni/Documents/Research/2013-LabalingTraceSegm/eclipseWS/CPL/lib/batik-swing/jar:/Users/Neni/Documents/Research/2013-LabalingTraceSegm/eclipseWS/CPL/lib/batik-transcoder/jar:/Users/Neni/Documents/Research/2013-LabalingTraceSegm/eclipseWS/CPL/lib/batik-parser/jar:/Users/Neni/Documents/Research/2013-LabalingTraceSegm/eclipseWS/CPL/lib/batik-css/jar:/Users/Neni/Documents/Research/2013-LabalingTraceSegm/eclipseWS/CPL/lib/batik-svg-dom/jar:/Users/Neni/Documents/Research/2013-LabalingTraceSegm/eclipseWS/CPL/lib/batik-ext/jar:/Users/Neni/Documents/Research/2013-LabalingTraceSegm/eclipseWS/CPL/lib/commons-lang-2/4/jar:/Users/Neni/Documents/Research/2013-LabalingTraceSegm/eclipseWS/CPL/bin:/Users/Neni/Documents/Research/2013-LabalingTraceSegm/eclipseWS/CPL/lib/tools/jar:/Users/Neni/Documents/Research/2013-LabalingTraceSegm/eclipseWS/CPL/lib/xalan-2/6/0/jar:/Users/Neni/Documents/Research/2013-LabalingTraceSegm/eclipseWS/CPL/lib/xerces_2_5_0/jar:/Users/Neni/Documents/Research/2013-LabalingTraceSegm/eclipseWS/CPL/lib/xml-apis/jar:/Users/Neni/Documents/Research/2013-LabalingTraceSegm/eclipseWS/CPL/lib/xml-apis-ext/jar:/Users/Neni/Documents/Research/2013-LabalingTraceSegm/eclipseWS/CPL/lib/cfparse:/Users/Neni/Documents/Research/2013-LabalingTraceSegm/eclipseWS/CPL/lib/bcel:/Users/Neni/Documents/Research/2013-LabalingTraceSegm/eclipseWS/CPL/lib/batik-awt-util/jar:/Users/Neni/ |