求救:windows环境下无法运行JAR包下的class文件
F:\>java -cp MinaTest.jar com.sony.client.test.QzjTemp.class
Exception in thread "main"
java.lang.NoClassDefFoundError: com/sany/client/test/
QzjTemp/class
Caused by:
java.lang.ClassNotFoundException: com.sony.client.test.QzjTemp.class
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
Could not find the main class: com.sony.client.test.QzjTemp.class. Program will
exit.
该class文件运行一个Main函数,弹出对话框
String path=JOptionPane.showInputDialog(null,"请输入路径:");
File file = new File(path);
------解决方案--------------------试试java -cp MinaTest.jar com.sony.client.test.QzjTemp
------解决方案--------------------执行java程序,不需要加.class的
改成
java -cp MinaTest.jar com.sony.client.test.QzjTemp