CUPS and old java (commercial software)

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

CUPS and old java (commercial software)

Helmut Jarausch
Hi,

I'm in need to use some commercial software (Matlab and Maple) which
come with their own (probably old) version of Java.

Now, both of those software packages cannot print, they don't see any
CUPS printer UNLESS I remove the symlink /usr/lib/libcups.so which
points to libcups.so.2

But some GenToo packages do need that link, e.g. x11-lib/qt-gui won't
install unless that link is there.

I remember there is a bug with older versions of Java accessing CUPS,
and probably my commercial packages contain such an old version.

Does anybody know how to fix or circumvent this.
(Currently I have to remove the symlink when using one of these
commercial packages and reinstall it afterwards, but ... for a normal
user without root priviledges that's not possible unless I write an SUID
script)

Thanks for any hints,

Helmut Jarausch

Lehrstuhl fuer Numerische Mathematik
RWTH - Aachen University
D 52056 Aachen, Germany

Reply | Threaded
Open this post in threaded view
|

Re: CUPS and old java (commercial software)

J. Roeleveld
On Wednesday 08 July 2009 16:47:57 Helmut Jarausch wrote:

> Hi,
>
> I'm in need to use some commercial software (Matlab and Maple) which
> come with their own (probably old) version of Java.
>
> Now, both of those software packages cannot print, they don't see any
> CUPS printer UNLESS I remove the symlink /usr/lib/libcups.so which
> points to libcups.so.2
>
> But some GenToo packages do need that link, e.g. x11-lib/qt-gui won't
> install unless that link is there.
>
> I remember there is a bug with older versions of Java accessing CUPS,
> and probably my commercial packages contain such an old version.
>
> Does anybody know how to fix or circumvent this.
> (Currently I have to remove the symlink when using one of these
> commercial packages and reinstall it afterwards, but ... for a normal
> user without root priviledges that's not possible unless I write an SUID
> script)
>
> Thanks for any hints,

Just an idea, not tested:

Is there another "libcups.so" file somewhere?
If yes, create a wrapper-script that puts the location of the other
"libcups.so" file first in the search list for the LDPATH-variable.

HTH,

Joost

Reply | Threaded
Open this post in threaded view
|

Re: CUPS and old java (commercial software)

Helmut Jarausch
On  8 Jul, J. Roeleveld wrote:

> On Wednesday 08 July 2009 16:47:57 Helmut Jarausch wrote:
>> Hi,
>>
>> I'm in need to use some commercial software (Matlab and Maple) which
>> come with their own (probably old) version of Java.
>>
>> Now, both of those software packages cannot print, they don't see any
>> CUPS printer UNLESS I remove the symlink /usr/lib/libcups.so which
>> points to libcups.so.2
>>
>> But some GenToo packages do need that link, e.g. x11-lib/qt-gui won't
>> install unless that link is there.
>>
>> I remember there is a bug with older versions of Java accessing CUPS,
>> and probably my commercial packages contain such an old version.
>>
>> Does anybody know how to fix or circumvent this.
>> (Currently I have to remove the symlink when using one of these
>> commercial packages and reinstall it afterwards, but ... for a normal
>> user without root priviledges that's not possible unless I write an SUID
>> script)
>>
>> Thanks for any hints,
>
> Just an idea, not tested:
>
> Is there another "libcups.so" file somewhere?
> If yes, create a wrapper-script that puts the location of the other
> "libcups.so" file first in the search list for the LDPATH-variable.
>

Unfortunately, there are only two of them
/usr/lib32/libcups.so
and
/usr/lib64/libcups.so

where /usr/lib is a symlink to /usr/lib64

Reply | Threaded
Open this post in threaded view
|

Re: CUPS and old java (commercial software)

Peter Alfredsen-3
In reply to this post by Helmut Jarausch
On Wed, 08 Jul 2009 16:47:57 +0200 (CEST)
Helmut Jarausch <[hidden email]> wrote:

> Hi,
>
> I'm in need to use some commercial software (Matlab and Maple) which
> come with their own (probably old) version of Java.
>
> Now, both of those software packages cannot print, they don't see any
> CUPS printer UNLESS I remove the symlink /usr/lib/libcups.so which
> points to libcups.so.2
>
> But some GenToo packages do need that link, e.g. x11-lib/qt-gui won't
> install unless that link is there.
>
> I remember there is a bug with older versions of Java accessing CUPS,
> and probably my commercial packages contain such an old version.

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6516881
Which leads to:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6500903

which suggests that a wrapper script like this for starting matlab
should do the trick:

---------o<---------------o<-------
#!/bin/bash
export CUPS_SERVER=localhost
command_to_start_matlab
---------o<---------------o<-------

Alternately, try commenting out the line
Listen /var/run/cups/cups.sock
in /etc/cups/cupsd.conf and restarting cups
( If that is an acceptable solution for you, since this will mean cups
only listen on the TCP socket )

/loki_val

Reply | Threaded
Open this post in threaded view
|

Re: CUPS and old java (commercial software)

Marc Joliet
In reply to this post by Helmut Jarausch
Am Wed, 08 Jul 2009 16:47:57 +0200 (CEST)
schrieb Helmut Jarausch <[hidden email]>:

> Hi,

Hi,

> I'm in need to use some commercial software (Matlab and Maple) which
> come with their own (probably old) version of Java.
>
> Now, both of those software packages cannot print, they don't see any
> CUPS printer UNLESS I remove the symlink /usr/lib/libcups.so which
> points to libcups.so.2
>
> But some GenToo packages do need that link, e.g. x11-lib/qt-gui won't
> install unless that link is there.
>
> I remember there is a bug with older versions of Java accessing CUPS,
> and probably my commercial packages contain such an old version.
>
> Does anybody know how to fix or circumvent this.
> (Currently I have to remove the symlink when using one of these
> commercial packages and reinstall it afterwards, but ... for a normal
> user without root priviledges that's not possible unless I write an SUID
> script)
I can't speak for Maple, but for Matlab you can export the variable
$MATLAB_JAVA. I have

marcec@marcec ~ % echo $MATLAB_JAVA
/usr/lib/jvm/emul-linux-x86-java-1.6

You can check if it worked via "matlab -e" in a shell or with the following
Matlab command:

  EDU>> version('-java')        
  ans =
  Java 1.5.0 with Sun Microsystems Inc. Java HotSpot(TM) Client VM mixed mode

That's the Java that's shipped with my 2007a installation. For comparison,
with $MATLAB_JAVA set as above:

  EDU>> version('-java')
  ans =
  Java 1.6.0_13 with Sun Microsystems Inc. Java HotSpot(TM) Client VM mixed
  mode, sharing

I just tested printing from the editor and it works with the system 32bit JVM,
but not with the shipped one, so it should work for you.

I'm not sure about stability, though. I never used to have problems, but more
or less recently Matlab would SEGFAULT occasionally (even though I set this
variable long before the SEGFAULTs started). While using the shipped JVM, it
never crashed. It could be completely unrelated to the JVM being used, but I
think it's better to be aware of the possibility.

> Thanks for any hints,
>
> Helmut Jarausch
>
> Lehrstuhl fuer Numerische Mathematik
> RWTH - Aachen University
> D 52056 Aachen, Germany

HTH
--
Marc Joliet
--
"People who think they know everything really annoy those of us who know we
don't" - Bjarne Stroustrup

signature.asc (205 bytes) Download Attachment