使用appletviewer从jar文件运行applet

时间:2015-01-12 11:53:08

标签: java android jar applet

我正在尝试使用jar运行一个包含applet的示例项目。

这是applet jar的位置 -

C:\DATA\setups\ACR1281U-C1 SDK v1.0\EXTRA\pcsc-sdk_2-21\pcsc-sdk\samples\java\jpcscapplet\demo

Cmd

java -cp "C:\DATA\setups\ACR1281U-C1 SDK v1.0\EXTRA\pcsc-sdk_2-21\pcsc-sdk\samples\java\jpcscapplet\demo\applet_pcsc.jar" applet_pcsc

错误

C:\DATA\setups\ACR1281U-C1 SDK v1.0\EXTRA\pcsc-sdk_2-21\pcsc-sdk\samples\java\jp
cscapplet\demo>java -cp "C:\DATA\setups\ACR1281U-C1 SDK v1.0\EXTRA\pcsc-sdk_2-21
\pcsc-sdk\samples\java\jpcscapplet\demo\applet_pcsc.jar" applet_pcsc
Exception in thread "main" java.lang.NoClassDefFoundError: netscape/javascript/J
SException
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
        at java.lang.Class.getMethod0(Unknown Source)
        at java.lang.Class.getMethod(Unknown Source)
        at sun.launcher.LauncherHelper.getMainMethod(Unknown Source)
        at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
Caused by: java.lang.ClassNotFoundException: netscape.javascript.JSException
        at java.net.URLClassLoader$1.run(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)
        ... 6 more

jar文件的内容 enter image description here

另外,我尝试编译并运行代码,而不是使用jar -still没有成功,applet没有启动

Cmd的

    C:\DATA\setups\ACR1281U-C1 SDK v1.0\EXTRA\pcsc-sdk_2-21\pcsc-sdk\samples\java\jp
cscapplet\src>javac JpcscApplet.java
Note: JpcscApplet.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

C:\DATA\setups\ACR1281U-C1 SDK v1.0\EXTRA\pcsc-sdk_2-21\pcsc-sdk\samples\java\jp
cscapplet\src>appletviewer JpcscApplet.java

我没有开发这个小程序,我正在开发基于主机卡的Android应用程序,需要查看nfc读卡器日志,这是读者供应商提供的代码,No supported card terminal found ARC1281U nfc card reader

推荐链接:

Failing to execute the jar file using java -jar command

请帮助,我还没有使用java项目! 感谢。

0 个答案:

没有答案