I use the command line on Windows to compile and then run my java programs. I went to http://java.sun.com/docs/books/tutorial/uiswing/start/compile.html and tried to compile the HelloWorldSwing.java class. it worked, but when I try java HelloWorldSwing, it gives me a bunch of erros and says something like Exception lines in the main stream java.lang.NoClassDefFoundError: HelloWorldSwing (wrong name: start / HelloWorldSwing)
I am trying to start java start / HelloWorldSwing and it says noClassDefFoundError. I am not getting errors with javac either. here is the code from the tutorial:
import javax.swing.*;
public class HelloWorldSwing {
private static void createAndShowGUI() {
JFrame frame = new JFrame("HelloWorldSwing");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JLabel label = new JLabel("Hello World");
frame.getContentPane().add(label);
frame.pack();
frame.setVisible(true);
}
public static void main(String[] args) {
javax.swing.SwingUtilities.invokeLater(new Runnable() {
public void run() {
createAndShowGUI();
}
});
}
}
EDIT: used by javaw
a popup will appear
"java error occurred"
another window
": .
: jni, . "
- java-, - ? , ?
, .java .class.
, , .
EDIT2
/HelloWorldSwing HelloWorldSwing java.
javac. 2 , , javaw, java NoClassDefFoundException, ClassLoaders -.
EDIT3
, " "; . , ?
javaw , .
jao