Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » JNI java.lang.UnsatisfiedLinkError with chain of libraries
JNI java.lang.UnsatisfiedLinkError with chain of libraries [message #645773] Mon, 20 December 2010 14:26 Go to next message
Benjamin Bihler is currently offline Benjamin BihlerFriend
Messages: 20
Registered: July 2009
Junior Member

can someone help me with loading native libraries in an eclipse fragment? My fragment on a Linux 64 bit system contains the following code:

public void loadLibraries()
System.out.println( "LD_LIBRARY_PATH: " + System.getenv( "LD_LIBRARY_PATH" ) );

System.out.println( "Loading library 2" );
System.loadLibrary( "2" );
System.out.println( "Loading library 1" );
System.loadLibrary( "1" );

System.out.println( "Finished loading libraries!" );
catch( UnsatisfiedLinkError unsatisfiedLinkError )

and two libraries "" and "" in the fragment root path.

Loading library 2 works great, since it does not depend on any other libraries. But library 1 is linked against library 2. When I try to load it I get this output:

------------------------------------------------------------ -------------------------
LD_LIBRARY_PATH: /usr/lib/jvm/java-6-sun- ib/jvm/java-6-sun- -sun-
Loading library 2
Loading library 1
java.lang.UnsatisfiedLinkError: /home/bbihler/StarTeam/ModelManager/Development/ExtensionPlu gins/MeshingLibWrapperLinux64/ Kann die Shared-Object-Datei nicht öffnen: Datei oder Verzeichnis nicht gefunden
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(
at java.lang.ClassLoader.loadLibrary(
at java.lang.Runtime.loadLibrary0(
at java.lang.System.loadLibrary(
at com.twt.meshinglibwrapper.linux64.libraryloaders.Linux64Libr aryLoader.loadLibraries(
at com.twt.meshinglibwrapper.activators.MeshingLibWrapperActiva tor.loadLibraries(
at com.twt.batchmerger.handlers.BatchMergeHandler.execute(Batch
at org.eclipse.ui.internal.handlers.HandlerProxy.execute(Handle
at org.eclipse.core.commands.Command.executeWithChecks(Command. java:476)
at org.eclipse.core.commands.ParameterizedCommand.executeWithCh ecks(
at org.eclipse.ui.internal.handlers.HandlerService.executeComma nd(
at org.eclipse.ui.internal.handlers.SlaveHandlerService.execute Command(
at org.eclipse.ui.menus.CommandContributionItem.handleWidgetSel ection(
at org.eclipse.ui.menus.CommandContributionItem.access$19(Comma
at org.eclipse.ui.menus.CommandContributionItem$5.handleEvent(C
at org.eclipse.swt.widgets.EventTable.sendEvent( :84)
at org.eclipse.swt.widgets.Widget.sendEvent(
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3540)
at org.eclipse.swt.widgets.Display.readAndDispatch( :3161)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2640)
at org.eclipse.ui.internal.Workbench.runUI(
at org.eclipse.ui.internal.Workbench.access$4( 38)
at org.eclipse.ui.internal.Workbench$
at org.eclipse.core.databinding.observable.Realm.runWithDefault (
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at com.twt.modelmanager.gui.Application.start( 130)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .runApplication(
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe
at java.lang.reflect.Method.invoke(
at org.eclipse.equinox.launcher.Main.invokeFramework( 619)
at org.eclipse.equinox.launcher.Main.basicRun(
at org.eclipse.equinox.launcher.Main.main(

------------------------------------------------------------ -------------------------

I have searched the internet for hints how to load libraries with dependencies, but the only advice I have found was to load the base libraries before the depending libraries. In the example above I already do this, but it does not work.

Can someone help me?

Thank you very much,
Benjamin Bihler
Re: JNI java.lang.UnsatisfiedLinkError with chain of libraries [message #645950 is a reply to message #645773] Tue, 21 December 2010 10:06 Go to previous message
Benjamin Bihler is currently offline Benjamin BihlerFriend
Messages: 20
Registered: July 2009
Junior Member
I have found the reason why loading the basic libraries before the depending libraries does not work in my case: this is only a workaround on Windows systems, not on Linux systems.

My problem was reported as the following bug:

Unfortunately there seems to be no clear solution... any help is appreciated!!!

Previous Topic:Is it necessary to add a plugin dependency when using extension points?
Next Topic:File Selection from within VariableResolver
Goto Forum:

Current Time: Sun Oct 04 17:15:35 GMT 2015

Powered by FUDForum. Page generated in 0.02441 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software