Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-dev] JNLP and win32 - java.library.path

Hi Chad,

Please use the newsgroups instead of the developer mailing lists for 
questions like this.   For this one, please use the RCP newsgroup.  There 
are others with experience deploying SWT and RCP apps there who may be 
able to help.
http://wiki.eclipse.org/index.php/Rich_Client_Platform#newsgroups

Regards,
Nick




Chad Oleary <oleary.chad@xxxxxxxxx> 
Sent by: platform-dev-bounces@xxxxxxxxxxx
01/21/2006 08:14 PM
Please respond to
col and "Eclipse platform general developers list."


To
platform-dev@xxxxxxxxxxx
cc

Subject
[platform-dev] JNLP and win32 - java.library.path






Hi,
 
I hope this is the right place to post this. If not, could you point me in 
the right direction? I'm having a problem that looks like a usual suspect 
at first glance. However, I've done my homework, and this one isn't the 
norm... 
 
I'm trying to use JNLP to launch an application. It works fine for Linux 
clients, but not Windows clients. I've been doing some testing, and the 
problem still exists even in the SWT examples, like ControlExample. 
Launches fine in Linux, but not Windows. If I run them as executable jars 
on windows, both the examples and the application I'm trying to package 
work fine. 
 
Here's the error.. 
 
java.lang.reflect.InvocationTargetException
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke (Unknown Source)
 at java.lang.reflect.Method.invoke(Unknown Source)
 at com.sun.javaws.Launcher.executeApplication(Unknown Source)
 at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
 at com.sun.javaws.Launcher.continueLaunch (Unknown Source)
 at com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source)
 at com.sun.javaws.Launcher.handleLaunchFile(Unknown Source)
 at com.sun.javaws.Launcher.run(Unknown Source)
 at java.lang.Thread.run (Unknown Source)
Caused by: java.lang.UnsatisfiedLinkError: no swt-win32-3139 in 
java.library.path
 at java.lang.ClassLoader.loadLibrary(Unknown Source)
 at java.lang.Runtime.loadLibrary0(Unknown Source)
 at java.lang.System.loadLibrary (Unknown Source)
 at org.eclipse.swt.internal.Library.loadLibrary(Library.java:123)
 at org.eclipse.swt.internal.win32.OS.<clinit>(OS.java:18)
 at org.eclipse.swt.widgets.Display.<clinit>(Display.java :125)
 at 
org.eclipse.swt.examples.controlexample.ControlExample.main(ControlExample.java:184)
 ... 11 more
 
Looks pretty standard, right? java.library.path issue. However, I've dealt 
with that in the past. I went so far as to set java.library.path to "." 
using System.setProperty("java.library.path", "."); Then I created an 
inital executable jar that's sole job was to unpack the swt dll's into 
".". I also tried setting java.library.path in my .jnlp as a resource 
property.  Also, I've tried setting java.library.path using a -D passed to 
the vm, nothing.. I'm pretty sure that java is setting the 
java.library.path correctly, or else I'd expect the exectable jars to 
fail. 
 
Now, I'm at the point where I'm doing it word for word from the very well 
documented FAQ's. I've found two of them, both nearly identical, on the 
main swt website. Here are the main .jnlp I'm using...
 
<?xml version="1.0" encoding="utf-8"?>
<jnlp
  spec="1.0+"
  codebase= http://www.foo.com/bar
  href="swtexamples.jnlp"> 
  <information>
    <title>SWT Examples</title>
    <vendor>Your website</vendor>
    <homepage href=" http://eclipse.org/swt"/ >
    <description>SWT ControlExample</description>
    <offline-allowed/>
  </information>
  <security>
      <all-permissions/>
  </security>
  <resources> 
    <j2se version="1.3+"/>
    <jar href="swtexamples.jar"/>
    <extension name="swt" href="swt/swt.jnlp"/>
  </resources>
  <application-desc main-class=" 
org.eclipse.swt.examples.controlexample.ControlExample"/>
</jnlp>
 
Here's the SWT extension jnlp:
 
<?xml version="1.0" encoding="utf-8"?>
<jnlp
  spec="1.0+"
  codebase=" http://www.foo.com/bar/swt";
  href="swt.jnlp ">
  <information>
    <title>SWT Libraries</title>
    <homepage href=" http://www.eclipse.org/swt"/>
    <description>SWT Libraries</description> 
    <offline-allowed/>
    <vendor>Your website</vendor>
  </information>
  <security>
    <all-permissions/>
  </security>
  <resources os="Windows" arch="x86"> 
    <jar href="os/win32/x86/swt.jar"/>
    <nativelib href="os/win32/x86/swtNativeLib.jar"/>
  </resources>
  <resources os="Linux" arch="i386"> 
    <jar href="os/linux/x86/swt.jar"/>
    <nativelib href="os/linux/x86/swtNativeLib.jar"/>
  </resources>
  <component-desc/>
</jnlp>
 
And, here's the directory structure:
 
4       ./swt/swt.jnlp
1236    ./swt/os/linux/x86/swt.jar
244     ./swt/os/linux/x86/swtNativeLib.jar
1484    ./swt/os/linux/x86
1488    ./swt/os/linux
1304    ./swt/os/win32/x86/swt.jar
88      ./swt/os/win32/x86/swtNativeLib.jar 
1396    ./swt/os/win32/x86
1400    ./swt/os/win32
2892    ./swt/os
2900    ./swt
4       ./swtexamples.jnlp
208     ./swtexamples.jar
 
Any thoughts, pointing out typos, comments, etc.. would be welcomed. If 
there's anything else I can provide, please let me know. Also, if anyone 
knows how to get a console for a JNLP launched app, that would help me 
greatly. 
 
Thanks,
 
--Chad
_______________________________________________
platform-dev mailing list
platform-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/platform-dev




Back to the top