Java applet stopped working after update to JRE 7u21

回眸只為那壹抹淺笑 提交于 2019-11-27 14:43:57

The error is most likely because a Jar file is missing, or can not be accessed by the applet. This would be because:

  1. The JAR was on the classpath of the old JVM, but is not on the new one.
  2. For some reason you are distributing the applet without the JAR inadvertently, and the problem is unrelated to the upgrade to 7u2.
  3. The rules for applets accessing external JAR files has somehow changed, probably related to security, and you need to do something else to include them.

The JAR file you are missing is javahidapi, which can be found here: https://code.google.com/p/javahidapi/ . If you make sure it finds its way to the classpath, your applet will work.

Bailey S is right.Make sure that java can see that jar file.If you're using linux,set the path in /etc/environment path variable or in windows,just right click on my computer,go to properties,environment variables and set path there

Deploying applets is getting significantly harder as Oracle fixes security holes.

You mentioned your applet is signed -- are all of the JARs signed? There are several new attributes you'll need in your manifest files to get this to work.

Overview here: http://www.oracle.com/technetwork/java/javase/tech/java-code-signing-1915323.html

and you'll need this one in particular to get the manifest sorted out: http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/manifest.html

If you use some JARs that aren't signed, or that aren't all signed by you, you'll need the details here as well: http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/mixed_code.html

It's not possible to set the attributes of an applet to work both on versions after 7.0.21 and below it.

Trusted-Library: true

attribute works for the ones below 7.0.21 which causes a security dialog to be displayed (and most probably your code to be blocked) after 7.0.21. If you only put

Caller-Allowable-Codebase: *.yourdomain.com

to your manifest file, it starts to work fine with the versions after 7.0.21 but this time it stops with the versions below 7.0.21. This is a huge mess.

However they've fixed this ill behaviour with the latest version (7.0.51). So I suggest to use both attributes (Trusted-Library and Caller-Allowable-Codebase) which will work for Java 6 and 7.0.51. I don't think there is a solution for the ones between 7.0.21 and 7.0.45. (I do not support them, we ask our clients to upgrade to 7.0.51).

https://blogs.oracle.com/java-platform-group/entry/7u45_caller_allowable_codebase_and

I do not know DeploJava.js bu the problem ıs clearly a classpath problem.

As a method, we define all third party libraries in archive tag. DeploJava.js may have similar properties.

<APPLET   codebase="./"  code="AppletMainClass"   archive="printer_applet.jar, pdf-renderer.jar, library3.jar">

The same happened with me (in java environment) which ruined my whole day, netscape's JSObject is present in both jre's plugin.jar and jfxrt.jar, you'd need to exclude one. if you need a js call, i think you'd need plugin.jar jre 6 do not contain latest jfxrt.jar (JavaFX related solution for applets in web)so it used to work in jre6

also , do not use trusted library unless you want to sign individual jars separately. Hope this helps - Chaithanya

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!