Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4188007

Difference between 1.1 and 1.2 in calling Runtime.exec from javaw.exe

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P2 P2
    • None
    • 1.2.0
    • core-libs
    • None
    • x86
    • windows_nt

      Run the following program in 1.1.6 and 1.2 with javaw.exe:

      u:/jdk1.1.6/win32/bin/javaw.exe E
      u:/jdk1.2/win32/bin/javaw.exe E

      You will notice that 1.1.6 does not create a console window,
      whereas 1.2 does.


      import java.io.*;
      import java.awt.Frame;
      import java.awt.event.*;

      public class E {
          public static void main(String[] args) throws Exception {
      String java = System.getProperty("java.home") +
      File.separator + "bin" + File.separator + "java";
              String cmd = java + " E$Hello";
              Process p = Runtime.getRuntime().exec(cmd);
      p.waitFor();
          }

          static public class Hello {
      public static void main(String[] args) {
      Frame frame = new Frame("Hello, world!");

      WindowListener l = new WindowAdapter() {
      public void windowClosing(WindowEvent e) {
      System.exit(0);
      }
      };
      frame.addWindowListener(l);
      frame.setSize(200, 200);
      frame.setLocation(100, 100);
      frame.setVisible(true);
      }
          }
      }

      anand.palaniswamy@Eng 1998-11-06

            hongzh Hong Zhang
            apalanissunw Anand Palaniswamy (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: