JDK-4774022 : Exception in thread "main" java.lang.UnsatisfiedLinkError: Can't load library: /
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 1.4.1,1.4.2
  • Priority: P4
  • Status: Closed
  • Resolution: Cannot Reproduce
  • OS: solaris_2.6,solaris_7
  • CPU: sparc
  • Submitted: 2002-11-05
  • Updated: 2011-07-04
  • Resolved: 2011-07-04
Description

Name: gm110360			Date: 11/05/2002


FULL PRODUCT VERSION :
java version "1.4.1_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_01-b01)
Java HotSpot(TM) Client VM (build 1.4.1_01-b01, mixed mode)


FULL OPERATING SYSTEM VERSION :
SunOS krishna 5.6 Generic_105181-33 sun4u sparc SUNW,Ultra-60

A DESCRIPTION OF THE PROBLEM :
java tries to load
/opt/java-1.4.1/jre/lib/sparc/motif12/libmawt.so
where as
/opt/java-1.4.1/jre/lib/sparc/motif21/libmawt.so
is installed

I've installed the jdk by running
sh ./j2sdk-1_4_1_01-solaris-sparc.sh

I have updated my OS installation by installing all
recommended patches for solaris 2.6 (not just those
recommended for the j2SE).

REGRESSION.  Last worked in version 1.4

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1.java -jar demo/jfc/FileChooserDemo/FileChooserDemo.jar
2.
3.

EXPECTED VERSUS ACTUAL BEHAVIOR :
the java vm fails to startup because it tries to load the
file 'libmawt.so' from 'jre/lib/sparc/motif12' where only
the path 'jre/lib/sparc/motif21' exists. See error #1

As a workaround, I've tried to create the missing directory
'motif12' and copied the file 'libmawt.so' to it. Then I get
error no #2. On my system, only libXm.so.3 is installed.

ERROR MESSAGES/STACK TRACES THAT OCCUR :
=== Error #1 =======
Exception in thread "main" java.lang.UnsatisfiedLinkError: Can't load library:
/opt/java-1.4.1/jre/lib/sparc/motif12/libmawt.so
	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1371)
	at java.lang.Runtime.load0(Runtime.java:737)
	at java.lang.System.load(System.java:809)
	at java.lang.ClassLoader$NativeLibrary.load(Native Method)
	at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1473)
	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1389)
	at java.lang.Runtime.loadLibrary0(Runtime.java:788)
	at java.lang.System.loadLibrary(System.java:832)
	at sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:50)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.awt.NativeLibLoader.loadLibraries(NativeLibLoader.java:38)
	at sun.awt.DebugHelper.<clinit>(DebugHelper.java:29)
	at java.awt.Component.<clinit>(Component.java:507)

=== Error #2 =======
Exception in thread "main" java.lang.UnsatisfiedLinkError:
/opt/java-1.4.1/jre/lib/sparc/motif12/libmawt.so: ld.so.1: java: fatal:
libXm.so.4: open failed: No such file or directory
	at java.lang.ClassLoader$NativeLibrary.load(Native Method)
	at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1473)
	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1368)
	at java.lang.Runtime.load0(Runtime.java:737)
	at java.lang.System.load(System.java:809)
	at java.lang.ClassLoader$NativeLibrary.load(Native Method)
	at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1473)
	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1389)
	at java.lang.Runtime.loadLibrary0(Runtime.java:788)
	at java.lang.System.loadLibrary(System.java:832)
	at sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:50)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.awt.NativeLibLoader.loadLibraries(NativeLibLoader.java:38)
	at sun.awt.DebugHelper.<clinit>(DebugHelper.java:29)
	at java.awt.Component.<clinit>(Component.java:507)


REPRODUCIBILITY :
This bug can be reproduced always.
(Review ID: 166666) 
======================================================================

Comments
EVALUATION ###@###.### 2002-11-06 Solaris 2.6 is not a supported system for JDK 1.4.1. Regardless, if we don't ship motif12/libmawt.so, we shouldn't be attempting to load it. We should explicitly load motif21/libmawt.so only. In addition, it would be nice if there were a better error message, indicating that the patch which introduces Motif 2.1 is required. =============
17-09-2004

SUGGESTED FIX ###@###.### 2002-11-06 Strip references to Motif 1.2 from src/solaris/native/sun/awt/awt_LoadLibrary.c.
06-11-2002