LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 10-29-2009, 06:32 AM   #1
f000l
LQ Newbie
 
Registered: Mar 2008
Location: Sweden
Distribution: Slackware 13.0
Posts: 14

Rep: Reputation: 0
System not finding libjava.so


Hello

I'm using slackware13 (32bit), and just installed the jre package to be able to use java programs, but when i try to execute the java command, it complains about not finding libjava.so
Code:
Error: could not find libjava.so
Error: could not find Java 2 Runtime Environment.
libjava is located at
Code:
/usr/lib/java/lib/i386/libjava.so
And i've added the dir to ld.so.conf

I've tried symlinking the lib to /usr/lib but that doesn't work. I tried installing on another slack13 comp and there's no problem there :/

I need some help getting java to find it's lib.
 
Old 10-29-2009, 06:38 AM   #2
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 6,859

Rep: Reputation: 4399Reputation: 4399Reputation: 4399Reputation: 4399Reputation: 4399Reputation: 4399Reputation: 4399Reputation: 4399Reputation: 4399Reputation: 4399Reputation: 4399
You probably still need to logout and login again to re-initialize your enviroment. Or run
Code:
 . /etc/profile
in a shell right before running "java" if a reboot is not convenient at the time.

Eric
 
Old 10-29-2009, 06:41 AM   #3
f000l
LQ Newbie
 
Registered: Mar 2008
Location: Sweden
Distribution: Slackware 13.0
Posts: 14

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Alien Bob View Post
You probably still need to logout and login again to re-initialize your enviroment. Or run
Code:
 . /etc/profile
in a shell right before running "java" if a reboot is not convenient at the time.

Eric
Still can't find libjava, so I need to reboot? :/


EDIT: Rebooting now.

Last edited by f000l; 10-29-2009 at 06:55 AM.
 
Old 10-29-2009, 07:01 AM   #4
f000l
LQ Newbie
 
Registered: Mar 2008
Location: Sweden
Distribution: Slackware 13.0
Posts: 14

Original Poster
Rep: Reputation: 0
Ok, so reboot did'nt help :/
 
Old 10-29-2009, 07:33 AM   #5
disturbed1
Senior Member
 
Registered: Mar 2005
Location: USA
Distribution: Slackware
Posts: 1,133
Blog Entries: 6

Rep: Reputation: 223Reputation: 223Reputation: 223
What happens if you define the full path to java while executing the program?
/usr/lib/java/bin/java program

echo $PATH
Make sure java is in your path.

Are you using ssh by any chance? As Slackware does not explicitly export the java home with ssh. Normal ssh clients do not have an issue with this. I use an ssh client that does, and had to recompile ssh and add the java home to the default path.
 
Old 10-29-2009, 07:52 AM   #6
f000l
LQ Newbie
 
Registered: Mar 2008
Location: Sweden
Distribution: Slackware 13.0
Posts: 14

Original Poster
Rep: Reputation: 0
hmm. If i specify the whole path it works...

Code:
echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/games:/usr/lib/java/bin:.:/sbin:/usr/sbin
I am using SSH, yes. PuTTy from a machine running windows. I don't have to use the absolute path when i SSH to another local machine though.

Last edited by f000l; 10-29-2009 at 07:54 AM.
 
Old 10-29-2009, 08:06 AM   #7
kjhambrick
Senior Member
 
Registered: Jul 2005
Location: Round Rock, TX
Distribution: Slackware64 14.2 + Multilib
Posts: 1,188

Rep: Reputation: 600Reputation: 600Reputation: 600Reputation: 600Reputation: 600Reputation: 600
Quote:
Originally Posted by f000l View Post
Ok, so reboot did'nt help :/
Maybe check your environment like so:

Code:
env |grep -i java
You should find /usr/lib/java/bin {and / or} /usr/lib/java/jre/bin in your PATH and you should have JAVA_HOME in your environment as well. This is the output from the env-pipe-grep command from my laptop:

Code:
MANPATH=/usr/local/man:/usr/man:/usr/lib/java/man:/usr/lib/java/man:/usr/share/texmf/man
PATH=/usr/local/bin:/usr/bin:/bin:/usr/games:/home/konrad/bin:/opt/apache-ant/bin:/usr/lib/java/bin:/usr/lib/java/jre/bin:/usr/lib/qt/bin:/usr/share/texmf/bin
JAVA_HOME=/usr/lib/java
If not, you can add /usr/lib/java/bin (for the JDK) {and / or} /usr/lib/java/jre/bin (for the JRE) to the PATH varb in /etc/profile to set it up for all users:

Code:
PATH="$PATH:/usr/lib/java/bin:/usr/lib/java/jre/bin"
JAVA_HOME="/usr/lib/java"
export PATH JAVA_HOME
or add the same lines to ~/.profile to set it up for individual users.

HTH.

-- kjh
 
Old 10-29-2009, 08:18 AM   #8
f000l
LQ Newbie
 
Registered: Mar 2008
Location: Sweden
Distribution: Slackware 13.0
Posts: 14

Original Poster
Rep: Reputation: 0
I have java in my path according to the env listing.

Code:
env |grep -i java
MANPATH=/usr/local/man:/usr/man:/usr/lib/java/man
PATH=/usr/local/bin:/usr/bin:/bin:/usr/games:/usr/lib/java/bin:.:/sbin:/usr/sbin:/usr/lib/java/bin:/usr/lib/java/jre/bin
JAVA_HOME=/usr/lib/java
Code:
PATH="$PATH:/usr/lib/java/bin:/usr/lib/java/jre/bin"
JAVA_HOME="/usr/lib/java"
export PATH JAVA_HOME
Did'nt work for me
 
Old 10-29-2009, 08:25 AM   #9
easuter
Member
 
Registered: Dec 2005
Location: Portugal
Distribution: Slackware64 13.0, Slackware64 13.1
Posts: 538

Rep: Reputation: 62
Quote:
Originally Posted by f000l View Post
I have java in my path according to the env listing.

Code:
env |grep -i java
MANPATH=/usr/local/man:/usr/man:/usr/lib/java/man
PATH=/usr/local/bin:/usr/bin:/bin:/usr/games:/usr/lib/java/bin:.:/sbin:/usr/sbin:/usr/lib/java/bin:/usr/lib/java/jre/bin
JAVA_HOME=/usr/lib/java
Code:
PATH="$PATH:/usr/lib/java/bin:/usr/lib/java/jre/bin"
JAVA_HOME="/usr/lib/java"
export PATH JAVA_HOME
Did'nt work for me
Give this a try on the command line:

Code:
LD_LIBRARY_PATH=/usr/lib/java/lib/i386 program_name
Substitute "program_name" accordingly.
 
Old 10-29-2009, 08:28 AM   #10
kjhambrick
Senior Member
 
Registered: Jul 2005
Location: Round Rock, TX
Distribution: Slackware64 14.2 + Multilib
Posts: 1,188

Rep: Reputation: 600Reputation: 600Reputation: 600Reputation: 600Reputation: 600Reputation: 600
Quote:
Originally Posted by f000l View Post
I have java in my path according to the env listing.

Code:
env |grep -i java
MANPATH=/usr/local/man:/usr/man:/usr/lib/java/man
PATH=/usr/local/bin:/usr/bin:/bin:/usr/games:/usr/lib/java/bin:.:/sbin:/usr/sbin:/usr/lib/java/bin:/usr/lib/java/jre/bin
JAVA_HOME=/usr/lib/java
Code:
PATH="$PATH:/usr/lib/java/bin:/usr/lib/java/jre/bin"
JAVA_HOME="/usr/lib/java"
export PATH JAVA_HOME
Did'nt work for me
Shucks. One difference I have (looking back at your first post) is that I did not add java.so to /etc/ld.so.conf, so there are no libraries from my JAVA_HOME Tree:

As root:

Code:
[root@kjhlt4 ~]# ldconfig -p |grep -i java
        libqtjavasupport.so.1 (libc6) => /usr/lib/libqtjavasupport.so.1
        libqtjavasupport.so (libc6) => /usr/lib/libqtjavasupport.so
        libqtjava.so.1 (libc6) => /usr/lib/libqtjava.so.1
        libqtjava.so (libc6) => /usr/lib/libqtjava.so
        libkjava.so.1 (libc6) => /usr/lib/libkjava.so.1
        libkjava.so (libc6) => /usr/lib/libkjava.so
        libkdejava.so.1 (libc6) => /usr/lib/libkdejava.so.1
        libkdejava.so (libc6) => /usr/lib/libkdejava.so
As 'me':

Code:
[konrad@kjhlt4 TaxMap]$ /sbin/ldconfig -p |grep -i java
        libqtjavasupport.so.1 (libc6) => /usr/lib/libqtjavasupport.so.1
        libqtjavasupport.so (libc6) => /usr/lib/libqtjavasupport.so
        libqtjava.so.1 (libc6) => /usr/lib/libqtjava.so.1
        libqtjava.so (libc6) => /usr/lib/libqtjava.so
        libkjava.so.1 (libc6) => /usr/lib/libkjava.so.1
        libkjava.so (libc6) => /usr/lib/libkjava.so
        libkdejava.so.1 (libc6) => /usr/lib/libkdejava.so.1
        libkdejava.so (libc6) => /usr/lib/libkdejava.so
Maybe ?

-- kjh
 
Old 10-29-2009, 09:03 AM   #11
f000l
LQ Newbie
 
Registered: Mar 2008
Location: Sweden
Distribution: Slackware 13.0
Posts: 14

Original Poster
Rep: Reputation: 0
As me:
Code:
$ ldconfig -p |grep -i java
        libbeecrypt_java.so.0 (libc6) => /usr/lib/libbeecrypt_java.so.0
        libbeecrypt_java.so (libc6) => /usr/lib/libbeecrypt_java.so
And as root:
Code:
# ldconfig -p |grep -i java
        libbeecrypt_java.so.0 (libc6) => /usr/lib/libbeecrypt_java.so.0
        libbeecrypt_java.so (libc6) => /usr/lib/libbeecrypt_java.so
# cat /etc/ld.so.conf
/usr/local/lib
/usr/i486-slackware-linux/lib
/usr/lib
 
Old 10-29-2009, 09:24 AM   #12
kjhambrick
Senior Member
 
Registered: Jul 2005
Location: Round Rock, TX
Distribution: Slackware64 14.2 + Multilib
Posts: 1,188

Rep: Reputation: 600Reputation: 600Reputation: 600Reputation: 600Reputation: 600Reputation: 600
Sorry about the ldconfig wild-goose-chase ...

I thought said that you had added /usr/lib/java/lib/i386 to /etc/ld.so.conf ...

I am stumped ... ??? ...

Are you running the jdk java or the jre java (or something else) ?

Code:
$ which -a java
/usr/lib/java/bin/java
/usr/lib/java/jre/bin/java
I have both installed so I see both ...

Code:
$ /usr/lib/java/bin/java -version
java version "1.6.0_16"
Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
Java HotSpot(TM) Server VM (build 14.2-b01, mixed mode)

$ /usr/lib/java/jre/bin/java -version
java version "1.6.0_16"
Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
Java HotSpot(TM) Server VM (build 14.2-b01, mixed mode)

-- kjh
 
Old 10-29-2009, 09:53 AM   #13
f000l
LQ Newbie
 
Registered: Mar 2008
Location: Sweden
Distribution: Slackware 13.0
Posts: 14

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by kjhambrick View Post
Sorry about the ldconfig wild-goose-chase ...

I thought said that you had added /usr/lib/java/lib/i386 to /etc/ld.so.conf ...

I am stumped ... ??? ...

Are you running the jdk java or the jre java (or something else) ?

Code:
$ which -a java
/usr/lib/java/bin/java
/usr/lib/java/jre/bin/java
I have both installed so I see both ...

Code:
$ /usr/lib/java/bin/java -version
java version "1.6.0_16"
Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
Java HotSpot(TM) Server VM (build 14.2-b01, mixed mode)

$ /usr/lib/java/jre/bin/java -version
java version "1.6.0_16"
Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
Java HotSpot(TM) Server VM (build 14.2-b01, mixed mode)

-- kjh
Sorry 'bout that, I did have /usr/lib/java/lib/i386 when i first posted but then tested some stuff and later removed it, either way it doesn't solve ma problem.

$ which -a java
Code:
/bin/java
/usr/lib/java/bin/java
/usr/lib/java/bin/java
$ /usr/lib/java/bin/java -version
Code:
java version "1.6.0_16"
Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
Java HotSpot(TM) Client VM (build 14.2-b01, mixed mode, sharing)
Ok, so i renamed /bin/java to java.bak and created a symlink to /usr/lib/java/bin/java instead.. And now i can execute java from cmd-line :/
Problem solved i guess
 
Old 10-29-2009, 10:17 AM   #14
kjhambrick
Senior Member
 
Registered: Jul 2005
Location: Round Rock, TX
Distribution: Slackware64 14.2 + Multilib
Posts: 1,188

Rep: Reputation: 600Reputation: 600Reputation: 600Reputation: 600Reputation: 600Reputation: 600
Quote:
Originally Posted by f000l View Post
Sorry 'bout that, I did have /usr/lib/java/lib/i386 when i first posted but then tested some stuff and later removed it, either way it doesn't solve ma problem.

$ which -a java
Code:
/bin/java
/usr/lib/java/bin/java
/usr/lib/java/bin/java
<snip>

Ok, so i renamed /bin/java to java.bak and created a symlink to /usr/lib/java/bin/java instead.. And now i can execute java from cmd-line :/
Problem solved i guess

No Problem !

I wonder where /bin/java came from ?

I am still running Slackware 12.1 on my Laptop and I can't get at my brother's Slack 13.0-32 system right now ( logging out of KDE Kills his wireless so I can't ssh in until he logs in again )

Now that 'we' have KDE 4.3.2 in current, I happen to have Slackware-Current downloaded and ready to install on my laptop but I can't run tar -tvf ~/extra/jdk-6u16-i586-1.txz to see the contents of the package ...

Anyhow ... Thanks for the morning diversion before I get back into my 'day job' !

-- kjh

p.s. Anybody know how one would extract a .txz package on a Slackware 12.1 system without breaking tar and *pkg* on 12.1 ?
 
Old 10-29-2009, 11:26 AM   #15
kjhambrick
Senior Member
 
Registered: Jul 2005
Location: Round Rock, TX
Distribution: Slackware64 14.2 + Multilib
Posts: 1,188

Rep: Reputation: 600Reputation: 600Reputation: 600Reputation: 600Reputation: 600Reputation: 600
Quote:
Originally Posted by kjhambrick View Post
p.s. Anybody know how one would extract a .txz package on a Slackware 12.1 system without breaking tar and *pkg* on 12.1 ?
For the future ...

I built and installed the xz binary on my Slackware 12.1 system from ~/slackware-13.0-32/source/a/xz/xz-4.999.8beta.tar.bz2

Now that I have xz, I can browse the .txz packages like so:

Code:
xz -cd <<some_package>>.txz |tar -tvf - |less -eX
I am interested in the jdk because I do a bit of Java Development so I wanted to make sure the upgrade to 13.0-32 would not break my system ...

I looked at ~/slackware-13.0-32/slackware/l/jre-6u16-i586-1.txz and ~/slackware-13.0-32/extra/jdk-6/jdk-6u16-i586-1.txz and the install.sh in each and there are no references to bin/ in the package or install.sh.

-- kjh
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
compiling gcc seond fail around libjava stabu Linux - Software 3 01-22-2009 04:25 PM
Error: can't find libjava.so in AIX shipon_97 AIX 1 04-30-2007 12:41 PM
Need comparison - libjava for mozilla tw001_tw Slackware 1 02-08-2005 10:49 PM
Limewire + libjava.so not found on RH8???? Ice9 Linux - General 0 02-15-2003 02:48 PM
libjava.so not found! Gladiator Linux - General 3 12-05-2001 03:11 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 05:39 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration