我提供了一些源代碼示例,我想測試一些功能。 不幸的是,我與執行程序的問題:java:找不到主要的類:test/test。程序將退出
11:41:31 [[email protected] example]$ javac -g test/test.java
11:41:52 [[email protected] 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 [[email protected] example]$
我能做些什麼?
你能提供你的test.java嗎? – hmatar
請提供test.java的源代碼。 – theV0ID
public class test { public static final String USER_NAME =「Test」; public static final String USER_PASSWORD =「TEST」; public static final String RCA_PRODUCT_NAME =「LPM」; 私有靜態CardManagerAccessPoint cardManagerAccessPoint = null; public static void main(String [] args)throws Exception { ExampleInvocation(); } 公共靜態無效ExampleInvocation(){ .... } – user1977050