我是java新手..
我有一个示例结构如下:
/folder/foo.java /folder/bar.java /folder/foobar.java
现在我正在尝试运行 foobar.java 但我得到以下异常
Exception in thread "main" java.lang.ClassNotFoundException: /folder/foobar
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at org.apache.hadoop.util.RunJar.main(RunJar.java:149)
然后我尝试通过这样做来配置它
java -classpath . foobar
Exception in thread "main" java.lang.NoClassDefFoundError: foobar
Caused by: java.lang.ClassNotFoundException: foobar
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
有什么线索吗?谢谢