简体   繁体   中英

Error when run the java applet

I have did the following steps to create Creating Self-Signed Applets

Also, it gave me error when i run on the html page, I use both HTML 4.1 and HTML5

eytool -genkey -keystore mykeystore -alias myalias
Enter keystore password:  mypassword
What is your first and last name?
  [Unknown]:  
What is the name of your organizational unit?
  [Unknown]: 
What is the name of your organization?
  [Unknown]:  
What is the name of your City or Locality?
  [Unknown]: 
What is the name of your State or Province?
  [Unknown]:  
What is the two-letter country code for this unit?
  [Unknown]:  
  [no]:  yes
Enter key password for <myalias>
            (RETURN if same as keystore password):


and create mykeystore but i used jdk 1.7.0
after that i created the jar file by the following steps

C:\Users\Rahand\Desktop\draft>javac AudioRecording.java

C:\Users\Rahand\Desktop\draft>jar cvf AudioRecording.jar *.class
added manifest
adding: AudioRecording$1.class(in = 673) (out= 445)(deflated 33%)
adding: AudioRecording$2.class(in = 812) (out= 499)(deflated 38%)
adding: AudioRecording$CaptureThread.class(in = 1840) (out= 983)(deflated 46%)
adding: AudioRecording.class(in = 3227) (out= 1723)(deflated 46%)

C:\Users\Rahand\Desktop\draft>pack200 -r AudioRecording.jar


C:\Users\Rahand\Desktop\draft>jarsigner -keystore mykeystore -storepass (secretkye) -keypass (secretkye) AudioRecordin
g.jar myalias

Warning:
The signer certificate will expire within six months.

but when i run on the web the program has the following error

load: class JavaSound.class” />  <param name= not found.
java.lang.ClassNotFoundException: JavaSound.class” .>  <param name=
    at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
    at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
    at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Exception: java.lang.ClassNotFoundException: JavaSound.class” .>  <param name=

i am appreciated if help me to solve this problem... Thanks

As per your stacktrace :

 java.lang.ClassNotFoundException: JavaSound.class

Does JavaSound.class really exists in your jar file?

because when I see the jar compile stacke it looks like :

adding: AudioRecording$1.class(in = 673) (out= 445)(deflated 33%)
adding: AudioRecording$2.class(in = 812) (out= 499)(deflated 38%)
adding: AudioRecording$CaptureThread.class(in = 1840) (out= 983)(deflated 46%)
adding: AudioRecording.class(in = 3227) (out= 1723)(deflated 46%)

There is no class as JavaSound int your compiled jar file.

you should use AudioRecording.class instead of JavaSound.class in your param value

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM