错误信息:
E:\Work\FirstDemo\src\com\bebig>javac FirstTestDemo.java
E:\Work\FirstDemo\src\com\bebig>java FirstTestDemo
Exception in thread "main" java.lang.NoClassDefFoundError: FirstTestDemo (wrong
name: com/bebig/FirstTestDemo)
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(Unknown Source)
        at java.security.SecureClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.access$000(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClassInternal(Unknown Source)
Could not find the main class: FirstTestDemo.  Program will exit.
在环境变量path里加入:
%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar;D:\Program Files\Java\jre6\lib\rt.jar;