When I get just a Class object for "sun.tools.jconsole.OutputViewer" I also get a side effect: it launches jconsole. And current thread is waiting when jconsole will be closed by a user.
Such behavior is unexpected when I call Class.forName.
The code
public class JConsoleTest {
public static void main(String[] args) {
try {
Class aClass = Class.forName("sun.tools.jconsole.OutputViewer");
System.out.println(aClass);
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
}
}
Such behavior is unexpected when I call Class.forName.
The code
public class JConsoleTest {
public static void main(String[] args) {
try {
Class aClass = Class.forName("sun.tools.jconsole.OutputViewer");
System.out.println(aClass);
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
}
}