public class HelloWorld{...}

解决方案 »

  1.   

    class helloWorld{
        public static void main(Stirng [] s){
            JOptionPane.showMessageDialog(null, 
                                          "Hello World!",
                                          "Alert",  
                                          JOptionPane.INFORMATION_MESSAGE);
        } 
    }
      

  2.   

    根据这个继续出现这样的错误:hello.java:6: cannot resolve symbol
    symbol  : variable JOptionPane
    location: class helloWorld
                                          JOptionPane.INFORMATION_MESSAGE);
                                          ^
    hello.java:3: cannot resolve symbol
    symbol  : variable JOptionPane
    location: class helloWorld
            JOptionPane.showMessageDialog(null,
            ^
    2 errors
      

  3.   

    上面那个代码你要导入Swing包的,要不怎么可能有那个类
      

  4.   

    文件头加句 import javax.swing.*;
      

  5.   

    import javax.swing.*;public class helloWorld{
        public static void main(Stirng [] s){
            JOptionPane.showMessageDialog(null, 
                                          "Hello World!",
                                          "Alert",  
                                          JOptionPane.INFORMATION_MESSAGE);
        } 
    }
      

  6.   

    helloWorld.java
    import javax.swing.*;public class helloWorld{
        public static void main ( String args[] ) {
            JOptionPane.showMessageDialog(null, 
                                          "Hello World!",
                                          "Alert",  
                                          JOptionPane.INFORMATION_MESSAGE);
        } 
    }
    完整的是这样吧,但是还是出现同样的错误
      

  7.   

    你的JAVA_HOME怎么设的?我想可能是classpath的问题。
      

  8.   

    那就不要图形界面了helloWorld.java
    //import javax.swing.*;public class helloWorld{
        public static void main ( String args[] ) {
            System.out.println("hello world!");    } 
    }
      

  9.   

    这个程序不需要设置classpath 的吧!