简体   繁体   English

Applet jna.jar-java.lang.UnsatisfiedLinkError:无法加载库

[英]Applet jna.jar - java.lang.UnsatisfiedLinkError: Unable to load library

Below is my HTML code 以下是我的HTML代码

<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<applet codebase ="." code="CallApplet.class"
        archive="CallApplet.jar,jna.jar,platform.jar"
        height="100" width="100"/>
</body>
</html>

Above html file and all jars are in same folder 上面的html文件和所有jar文件都在同一文件夹中

What am i doing wrong here, im getting error java.lang.NoClassDefFoundError: com/sun/jna/Library 我在这里做错了什么,我收到错误java.lang.NoClassDefFoundError:com / sun / jna / Library

If you want to look into my applet code go to Applet runs in eclipse but not in browser - java security 如果要查看我的applet代码,请转到Applet在Eclipse中运行但不在浏览器中运行-Java Security

UPDATE 更新

I needed to sign all external jar files [jna and platform] 我需要签署所有外部jar文件[jna和平台]

now im getting error - java.lang.UnsatisfiedLinkError: Unable to load library 'TSCLIB': The specified module could not be found. 现在,我收到错误消息-java.lang.UnsatisfiedLinkError:无法加载库“ TSCLIB”:找不到指定的模块。

Basically this error is as it is trying to access a DLL file which is placed inside system32 folder. 基本上,此错误是因为它正试图访问放置在system32文件夹中的DLL文件。 Can anybody help on this 有人可以帮忙吗

I think i learned couple of things about JNA with applet 我认为我通过applet了解了有关JNA的一些知识

  1. First verify all jars with jarsigner whether they all are signed properly. 首先使用jarsigner验证所有jar,是否对它们进行了正确签名。

  2. In my case eclipse ran with 64bit JVM (so applet ran fine within it) and chrome ran with 32bit so i had to use different dlls for different JVMs. 在我的情况下,eclipse在64位JVM上运行(因此applet在其中运行良好),而chrome在32bit上运行,因此我不得不对不同的JVM使用不同的dll。 Also i placed dll files outside system32, say c: and loaded it using absolute path via System.load (I believe this can be dynamic). 我也将dll文件放在system32之外,例如c:,并通过System.load使用绝对路径加载了它(我相信这可以是动态的)。

Hope this will help others when developing applet with JNA 希望这对使用JNA开发applet的其他人有所帮助

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 JNA java.lang.UnsatisfiedLinkError:无法加载库&#39;./OUNPPM&#39; - JNA java.lang.UnsatisfiedLinkError: Unable to load library './OUNPPM' java.lang.UnsatisfiedLinkError:无法加载库 - java.lang.UnsatisfiedLinkError: Unable to load library 无法加载Xuggle库:java.lang.UnsatisfiedLinkError - Unable to load Xuggle library: java.lang.UnsatisfiedLinkError 线程“ main”中的异常java.lang.UnsatisfiedLinkError:无法加载库 - Exception in thread “main” java.lang.UnsatisfiedLinkError: Unable to load library JNA-Ubuntu上的java.lang.UnsatisfiedLinkError - JNA - java.lang.UnsatisfiedLinkError on Ubuntu 加载jar时出现java.lang.UnsatisfiedLinkError。 - java.lang.UnsatisfiedLinkError when i load a jar . java.lang.UnsatisfiedLinkError:无法加载库(使用Visual Studio 2015构建) - java.lang.UnsatisfiedLinkError: Unable to load library (with Visual Studio 2015 build) java.lang.UnsatisfiedLinkError:无法加载库“ TSCLIB”:找不到指定的模块 - java.lang.UnsatisfiedLinkError: Unable to load library 'TSCLIB': The specified module could not be found Ghost4J。 java.lang.UnsatisfiedLinkError:无法加载库“ gsdll64” - Ghost4J. java.lang.UnsatisfiedLinkError: Unable to load library 'gsdll64' 为什么我得到:线程“main”中的异常 java.lang.UnsatisfiedLinkError: Unable to load library &#39;argon2&#39;: - Why do I get: Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load library 'argon2':
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM