Classpath on Cgwin: UnsatisfiedLinkError problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Enrico,

On Wed, Feb 08, 2006 at 02:14:59PM +0100, Enrico Migliore wrote:
> after building Classpath on Cygwin, I'm now trying to use it in a simple
> HelloWorld application. As an interpreter, I'm using JC (by Archie Cobbs).
> 
> When I run:
> 
> $jc HelloWorld
> 
> I got the following exception:
> 
> java.lang.UnsatisfiedLinkError: failed to open native library:
> 'usr/local/classpath/lib/classpath/libjavanio.so'
> 
> The reason, I think, is that Classpath doesn't know it's running on Cygwin,
> therefore it looks for "libjavanio.so" instead of  "libjavanio.dll" (which
> exists on the filesytem).

When initially writing the CygwinOnClasspath[0] wiki entry on the
mediation wiki, I came across the same issue. I found that the problem
is actually not in GNU Classpath but more in how specific VMs deal with
loadLibrary calls.

For example, java.nio.channels.FileChannelImpl in GNU Classpath uses the
following for loading its native library:

if (Configuration.INIT_LOAD_LIBRARY)
  {
    System.loadLibrary("javanio");
  }

VM writers typically handle the delegated loadLibrary() call via their
implementation of the VM* interface classes and in their own native
code.

As cygwin uses a decidedly odd naming convention for its dlls, I'd say
those parts of jc would need to be investigated. IIRC, Cygwin calles its
equivalent of libjavanio.so cygjavanio-0.dll.

Hope this helps,

Steph

[0] http://developer.classpath.org/mediation/ClasspathOnCygwin
    
-- 
================================================================
Stephane Meslin-Weber         Email: steph@xxxxxxxxxxxxxx
Senior Software Engineer      Web: http://odonata.tangency.co.uk
================================================================
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://developer.classpath.org/pipermail/classpath/attachments/20060208/0234d55b/attachment.pgp

[Index of Archives]     [Linux Kernel]     [Linux Cryptography]     [Fedora]     [Fedora Directory]     [Red Hat Development]

  Powered by Linux