Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 486042

Summary: =dev-java/icedtea-bin-7.2.4.1 - java: Exception in thread "main" java.lang.UnsatisfiedLinkError: /opt/icedtea-bin-7.2.4.1/jre/lib/amd64/headless/libmawt.so: libcups.so.2: cannot open shared object file: No such file or directory
Product: Gentoo Linux Reporter: Felix C. Stegerman <flx>
Component: [OLD] JavaAssignee: Java team <java>
Status: RESOLVED FIXED    
Severity: normal CC: bertrand, bkohler, jakub, mr_bones_, prote
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
URL: http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=877
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: build.log
emerge --info =dev-lang/clojure-1.5.1
emerge -pqv =dev-lang/clojure-1.5.1
emerge --info =dev-java/icedtea-bin-7.2.4.1
emerge -pqv =dev-java/icedtea-bin-7.2.4.1

Description Felix C. Stegerman 2013-09-25 21:41:35 UTC
I'm using icedtea-bin-7.2.4.1 w/ USE=-cups; installing clojure resulted in 
"Exception in thread "main" java.lang.UnsatisfiedLinkError: /opt/icedtea-bin-7.2.4.1/jre/lib/amd64/headless/libmawt.so: libcups.so.2: cannot open shared object file: No such file or directory, compiling:(inspector.clj:9:1)";
clojure builds just fine with cups installed;
I'm not sure whether the fault lies with icedtea or clojure -- since icedtea seems to work fine otherwise, I decided to report the bug here.


Reproducible: Always
Comment 1 Felix C. Stegerman 2013-09-25 21:41:57 UTC
Created attachment 359478 [details]
build.log
Comment 2 Felix C. Stegerman 2013-09-25 21:42:29 UTC
Created attachment 359480 [details]
emerge --info =dev-lang/clojure-1.5.1
Comment 3 Felix C. Stegerman 2013-09-25 21:42:39 UTC
Created attachment 359482 [details]
emerge -pqv =dev-lang/clojure-1.5.1
Comment 4 Felix C. Stegerman 2013-09-25 21:46:15 UTC
Created attachment 359484 [details]
emerge --info =dev-java/icedtea-bin-7.2.4.1
Comment 5 Felix C. Stegerman 2013-09-25 21:46:24 UTC
Created attachment 359486 [details]
emerge -pqv =dev-java/icedtea-bin-7.2.4.1
Comment 6 El Goretto 2013-10-25 23:11:31 UTC
Same issue with running net-p2p/i2p v0.9.8.1:
2013/10/26 01:02:17 | Thread terminated unexpectedly: StatSummarizer
2013/10/26 01:02:18 | java.lang.UnsatisfiedLinkError: /opt/icedtea-bin-7.2.4.1/jre/lib/amd64/headless/libmawt.so: libcups.so.
Comment 7 El Goretto 2013-10-28 13:08:40 UTC
Probably related to bug #489564, as cups is not enabled on my system either.
Comment 8 Weedy 2014-04-16 03:48:18 UTC
Installed icetea-bin -cups fine. Went to run a JAR. I can't even build icedtea -X -cups. I don't want this crap on my server (I barely want java).

Exception in thread "main" java.lang.UnsatisfiedLinkError: /opt/icedtea-bin-7.2.4.3/jre/lib/amd64/headless/libmawt.so: libcups.so.2: cannot open shared object file: No such file or directory
        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
        at java.lang.ClassLoader.loadLibrary1(ClassLoader.java:1965)
        at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1890)
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1851)
        at java.lang.Runtime.load0(Runtime.java:795)
        at java.lang.System.load(System.java:1062)
        at java.lang.ClassLoader$NativeLibrary.load(Native Method)
        at java.lang.ClassLoader.loadLibrary1(ClassLoader.java:1965)
        at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1890)
        at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1872)
        at java.lang.Runtime.loadLibrary0(Runtime.java:849)
        at java.lang.System.loadLibrary(System.java:1088)
        at sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:67)
        at sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:47)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.awt.Toolkit.loadLibraries(Toolkit.java:1646)
        at java.awt.Toolkit.<clinit>(Toolkit.java:1668)
        at java.awt.Component.<clinit>(Component.java:595)
Comment 9 Vlastimil Babka (Caster) (RETIRED) gentoo-dev 2014-05-30 22:36:20 UTC
Hello. Unfortunately that's how icedtea works from upstream. We don't have the manpower to remove the deps from the build process and make them optional. We provide the USE flags so that icedtea(-bin) doesn't pull the deps if you know you are running java code that won't need them. So if your jar uses awt classes it will try to initialize that.
Hopefully this should get better upstream in new major versions some day.

As for clojure, I don't know if it's build system provides options to not build X/cups related parts. I'm reassigning to the maintainer to find out.
Comment 10 Vlastimil Babka (Caster) (RETIRED) gentoo-dev 2014-05-30 23:18:45 UTC
As for the cups part, there's actually upstream bug http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=877
Comment 11 Mr. Bones. (RETIRED) gentoo-dev 2014-05-31 07:25:23 UTC
This is pretty firmly in the "you broke it so you get to keep both pieces" category.  However, I think there could be more warnings in the icedtea-bin ebuild that explain that you're going to end up with a known-broken install if you override the recommended use flags.

That said, there's nothing really for me to do here.  clojure doesn't have knobs to configure things at build-time.
Comment 12 Ben Kohler gentoo-dev 2014-07-11 13:29:42 UTC
The files that are installed with broken linking when a user sets USE="-cups", should not be installed at all by our ebuild, that we CAN fix.  Same thing with USE="-X".  This is messing with our preserved-libs feature for a lot of people.
Comment 13 Patrice Clement gentoo-dev 2015-06-14 15:51:08 UTC
This version is long gone. Sync your sources and let us know if you still encounter this problem.
Comment 14 James Le Cuirot gentoo-dev 2015-06-14 16:05:41 UTC
Please leave icedtea bugs to me. This is still a problem.

% readelf -d /opt/icedtea-bin-7.2.5.5/jre/lib/amd64/headless/libmawt.so | fgrep cups
 0x0000000000000001 (NEEDED)             Shared library: [libcups.so.2]

Even if you have the cups flag disabled, this link is still present. Upstream is looking into it.
Comment 15 James Le Cuirot gentoo-dev 2015-09-08 09:36:04 UTC
Now fixed. icedtea-bin is now built from icedtea with the cups flag disabled. This doesn't actually disable cups entirely, it just causes it to be dlopen'd like Oracle's does.