日期:2014-05-20  浏览次数:20657 次

菜鸟提问之NO.1
我的环境配置:
JAVA_HOME:C:\j2sdk1.4.2_06
path:%JAVA_HOME%\bin
classpath:%JAVA_HOME%\lib

java文件代码:
import   javax.swing.JOptionPane;
class   Demo1{
    public   static   void   main(String   args[]){
              JOptionPane.showMessageDialog(null, "helloword! ", "helloword ",JOptionPane.INFORMATION_MESSAGE);
              System.out.println( "helloword ");
    }
}

编辑通过,生成class文件.
cmd:java   Demo1
error:Exception   in   thread   "main "   java.lang.NoClassDefFoundError:   Demo1

那位高手帮我看看,我检查环境变量都没有问题啊.怎么会找不到类呢?

------解决方案--------------------
classpath在加个当前目录 .
恩,分是我的