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
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
- duplicates
-
JDK-4109888 (process spec) Semantics of external process is not defined in JLS
- Closed