Ok here is the deal, With the Java 2 SDK 1.4.2, I am having problems running certain programs...
A program like this
Code:
public class Test
{
public static void main(String[] args)
{
System.out.println("Welcome to Java!");
}
}
compiles fine and then when I run it using java it will print out "Welcome to Java!"
BUT...................
A program like this
Code:
import javax.swing.*;
public class MyFrame
{
public static void main(String[] args)
{
JFrame frame = new JFrame("Test Frame");
frame.setSize(400,300);
frame.setVisible(true);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}
This one compiles just fine too but when I run it using java (I use java /home/dsl/MyFrame), I have this error "Exception in thread "main" java.lang.NoClassDefFoundError: MyFrame
Thanks if you can help here.