我得到了一些我想测试一些功能的源代码示例。不幸的是,我在执行程序时遇到问题:
11:41:31 [linqus@ottsrvafq1 example]$ javac -g test/test.java
11:41:52 [linqus@ottsrvafq1 example]$ java -classpath . test/test
Exception in thread "main" java.lang.NoClassDefFoundError: test/test (wrong name: test)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Could not find the main class: test/test. Program will exit.
11:42:57 [linqus@ottsrvafq1 example]$
我可以做什么?