2

I'm trying to run a sample project which has an applet using jar.

This is the location of the 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

Error

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

Content of the jar file enter image description here

Also, I tried to compile and run the code , instead of using jar -still no success , the applet doesnt start

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

I not developing this applet , I'm developing an Host card based android application and need to see nfc card reader logs ,this is the code provided by the reader vendor , No supported card terminal found ARC1281U nfc card reader

Referred links:

Failing to execute the jar file using java -jar command

Please help, I have not worked with java projects !! Thanks.

Community
  • 1
  • 1
Rachita Nanda
  • 4,509
  • 9
  • 42
  • 66
  • I'm pretty sure the applet viewer does not support the scripting classes.. – Andrew Thompson Jan 13 '15 at 00:46
  • @AndrewThompson what is a workaround ? thanks – Rachita Nanda Jan 13 '15 at 05:18
  • Run the applet in a browser. To refresh the class cache, open the [Java Console](http://www.java.com/en/download/help/javaconsole.xml) & type `x` before reloading the page. – Andrew Thompson Jan 13 '15 at 05:40
  • @AndrewThompson Thanks , can you pls share some link or info regarding how to run applet on browser , I have no knowledge of java projects. – Rachita Nanda Jan 13 '15 at 06:15
  • *"how to run applet on browser"* Seriously, you're developing an applet and do not know how to do that? Go through each of the **See also** links listed in the [applet info. page](http://stackoverflow.com/tags/applet/info). That is a summary of the best information I could find on applet development. – Andrew Thompson Jan 13 '15 at 06:31
  • @AndrewThompson I not developing an applet , Im developing an Host card based android application and need to see nfc card reader logs ,this is the code provided by the reader vendor , http://stackoverflow.com/questions/27846535/no-supported-card-terminal-found-arc1281u-nfc-card-reader Thanks for the help!! – Rachita Nanda Jan 13 '15 at 06:34
  • *"I not developing an applet.."* My bad, when I saw 'applet' and 'appletviewer' combined with 'Java' I resumed. Maybe you should add the Android tag. – Andrew Thompson Jan 13 '15 at 06:39
  • @RachitaNanda my be some other jar files needed in order to run this one, so `cp` should have other needed jar files?! – Yazan Jan 13 '15 at 11:12

0 Answers0