title: how to call a jar file in java program?
body: <p><strong>Hi everybody..
     i have a java program to convert Html to text file...
     but i want to call a stanford-postagger jar file to my java pgm..
     could anybody help me..</strong> </p>
  
  <p><strong><em>HERE IS MY JAVA PROGRAM TO CONVERT HTML TO TXT</em></strong></p>
  
  <pre><code>      import java.io.BufferedReader;
           import java.io.FileOutputStream;
                     import java.io.FileWriter;
  import java.io.FileReader;
  import java.io.IOException;
  import java.io.PrintStream;
  import java.util.StringTokenizer;
  import java.util.Scanner;
  import java.io.BufferedWriter;
  import java.io.FileNotFoundException;
  import java.io.File;
  
  public class conv {
  
  
      public static void main(String[] args) throws IOException {
  
  
  
  
      StringBuilder sb = new StringBuilder();
       BufferedReader br = new BufferedReader(new FileReader("C:/1.html"));
       String line;
       while ( (line=br.readLine()) != null) 
       {
         sb.append(line);
  
      }
       try
       {
           String nohtml = sb.toString().replaceAll("\\&lt;.*?&gt;","");
           PrintStream out = new PrintStream(new FileOutputStream("C:/Out.txt"));
           StringTokenizer st = new StringTokenizer(nohtml);
           while (st.hasMoreTokens())
           {
               out.println(st.nextToken().toString());
           }
  
             Scanner scan = new Scanner(System.in);
      System.out.print("Enter File Name:");
              String file_Name = "C:/"+scan.nextLine();
      //System.out.print("Enter Starting Word:");
      String start_word = "Good";
      //System.out.print("Enter Final Word:");
      String end_word = "Views,";
  
              conv file = new conv();
      String word = file.showLines(file_Name, start_word,end_word);
  
      System.out.println("&gt;&gt;&gt;");
      if(word.length()&gt;1)
          {
                //System.out.println(word);
      String[] words = word.split("\\,");
              for (String str : words)
              {
                System.out.println(str);
  
              try
              {
              PrintStream out1 = new PrintStream(new 
  
  FileOutputStream("c:/sampleoutput.txt"));
                  for (String astr : words)
                  {
                    out1.println(astr);
                  }
                  out1.println();
                 out1.close();            
           }  
                    /*StringTokenizer stg = new StringTokenizer(word, ".");
                      File newFile = new File("c:/newWords.txt");
                    try {
  
                          BufferedWriter writer= new BufferedWriter(new FileWriter(newFile,true));
  
                          while(stg.hasMoreTokens()) {
                              String val = stg.nextToken().trim()+".";
                              System.out.println(val);
                              writer.append(val);
                              writer.newLine();
                          }
                          writer.close();
                      }*/
      catch (Exception e) 
      {
                         // e.printStackTrace();
  System.out.println(e);
                      }
  
          }  
          }
  
  
          else
              System.out.println("### Not Found");
  
  
  }
  
  catch(Exception ex)
           {
               System.out.println(ex);
           }
  
  }
  
  
  public String showLines(String fileName, String start, String end)  {
  
      String word = "";
      try {
          Scanner scan = new Scanner(new File(fileName));
          while(scan.hasNext())
          {
              if(scan.next().equals(start)) 
              {
                  word = start;
  
                  while(scan.hasNext())
                  {
                      String test = scan.next();
                      word = word +" "+ test;
                      if(test.equals(end))
                          break;
  
  
                  }
  
  
              }
          }
      }
      catch (Exception e) 
      {
          e.printStackTrace();
      }
  
      return word;
  }
  }
  </code></pre>