import java.io.*;
import javax.swing.*;
import javax.tools.*;
import java.util.*;
import java.lang.Integer;
import java.awt.*;
import java.awt.event.*;
import java.awt.font.*;
import java.awt.geom.*;
import java.awt.image.*;
import javax.swing.*;
import java.util.Locale;
import java.text.*;
import java.util.*;
import javax.swing.table.*;
import static java.lang.Math.*;

public class realtime1
{      
	   
     
     public static void compileandrun(String isim)
     {
	  try{
      JavaCompiler javac = ToolProvider.getSystemJavaCompiler();
      int rc = javac.run(null,null,null,isim);}
      catch(NullPointerException e1) {System.err.println("NULL POINTER");} 
     }    
     
     
     public static void main(String arg[])
     {
	 String fileName=JOptionPane.showInputDialog("Enter file name (a.java): ");
	 compileandrun(fileName);	 
	 } 

}