Site hosted by Angelfire.com: Build your free website today!


 

 

 

 

 

Runtime_2.java
Created with JBuilder
package a1;

import java.io.*;

/************************************************************

  H:\DATI\Studi\JAVA\a1>java -cp classes  a1.Runtime_2
  main err.: Numero paramentri non valido

  H:\DATI\Studi\JAVA\a1>java -cp classes  a1.Runtime_2 xdummy
   Runtime_2 r2 = new Runtime_2( xdummy )
  IOException: CreateProcess: xdummy error=2

  H:\DATI\Studi\JAVA\a1>java -cp classes  a1.Runtime_2 sol
   Runtime_2 r2 = new Runtime_2( sol )

 ***********************************************************/

public class Runtime_2 {

  public Runtime_2( String str_cmd )
  {
    try   { Runtime.getRuntime().exec( str_cmd );  }
    catch (RuntimeException e ) { System.out.println( "RuntimeException: " + e.getMessage()); }
    catch (IOException e )      { System.out.println( "IOException: " + e.getMessage()); }
    catch (Exception e )        { System.out.println( "Exception: " + e.getMessage()); }

  }

  public static void main(String[] args)
  {
    try
    {
      // test numero di parametri
      if( args.length < 1 )
                {  throw new Exception( "Numero paramentri non valido" );   }
       System.out.println( " Runtime_2 r2 = new Runtime_2( " + args[0] + " ) " );
       Runtime_2 r2 = new Runtime_2( args[0] );
    }
    catch ( Exception e ) { System.out.println( "main err.: " + e.getMessage()); }
  }


}

Runtime_2.java
Created with JBuilder

   if you have some suggestion or question about this program please mail me at enzo.arlati@libero.it

Main index 
NEWS

 

Last update:   19-01-2003

Hosted by :  
Xoom