LinuxQuestions.org
Review your favorite Linux distribution.
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-16-2019, 12:40 PM   #1
Bad Blue Bull
Member
 
Registered: Jul 2017
Distribution: Slackware 14.2
Posts: 45

Rep: Reputation: Disabled
Error: could not find libjava.so


I run into this when installing mysql-workbench with sbopkg:
Code:
Using bundled Antlr C runtime
[mysql] Generating parser files...
Selected MySQL parser
Error: could not find libjava.so
Error: Could not find Java SE Runtime Environment.
Error: could not find libjava.so
Error: Could not find Java SE Runtime Environment.
CMake Error at library/parsers/grammars/CMakeLists.txt:9 (message):
  [mysql] Generating parsers files failed with result='2'
I have installed JRE using this SlackBuild: https://mirrors.dotsrc.org/slackware...ava.SlackBuild
locate libjava.so gives:
Code:
/usr/lib64/java/lib/amd64/libjava.so
/usr/lib64/java/jre/lib/amd64/libjava.so
Content of my /etc/ld.so.conf is:
Code:
/lib64
/usr/lib64
/usr/local/lib64
/usr/x86_64-slackware-linux/lib64
/usr/lib64/seamonkey
/usr/lib64/java/lib/amd64/
/usr/lib64/java/lib/amd64/jli
/usr/lib64/java/jre/lib/amd64/
/opt/kde3/lib64
My path when logged as root contains /usr/lib64/java/bin and /usr/lib64/java/jre/bin and I can execute javac when logged as root or after sudo -i .
Update: I have tried to run Hello World in Java, compiled alright but same problem when run:
Quote:
Error: could not find libjava.so
Error: Could not find Java SE Runtime Environment.

Last edited by Bad Blue Bull; 10-16-2019 at 12:49 PM.
 
Old 10-16-2019, 12:45 PM   #2
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 6,044

Rep: Reputation: Disabled
mysql-workbench doesn't depend on jre, it depends on jdk.

Quote:
Originally Posted by Bad Blue Bull View Post
Update: I have tried to run Hello World in Java, compiled alright but same problem when run:
have you logged out and logged in again after installing the package?

Last edited by ponce; 10-16-2019 at 12:59 PM.
 
Old 10-16-2019, 01:01 PM   #3
Bad Blue Bull
Member
 
Registered: Jul 2017
Distribution: Slackware 14.2
Posts: 45

Original Poster
Rep: Reputation: Disabled
Ponce: I've downloaded jdk from the Oracle site and put it somewhere in /tmp/Sbo/ where installer wanted it then I made installation go on. Now I see Java isn't running, it's not just problem with mysql-workbench installer.
Yes, I've logged out and logged in and rebooted also because this battle has been going on for days.

Last edited by Bad Blue Bull; 10-16-2019 at 01:02 PM.
 
Old 10-16-2019, 01:02 PM   #4
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 6,044

Rep: Reputation: Disabled
Quote:
Originally Posted by ponce View Post
have you logged out and logged in again after installing the package?
you should log out and log in again after installing the package so that your shell loads the files that it installs in /etc/profile.d/
Code:
/usr/lib64/java/lib/amd64/
/usr/lib64/java/lib/amd64/jli
/usr/lib64/java/jre/lib/amd64/
you shouldn't need these...
Quote:
Originally Posted by Bad Blue Bull View Post
Now I see Java isn't running
sorry, what do you mean?
Quote:
Originally Posted by Bad Blue Bull View Post
Ponce: I've downloaded jdk from the Oracle site and put it somewhere in /tmp/Sbo/ where installer wanted it then I made installation go on.
the procedure that you are describing doesn't look like you built and installed a package from the jdk.SlackBuild on SBo...

Last edited by ponce; 10-16-2019 at 01:07 PM.
 
Old 10-16-2019, 01:15 PM   #5
Bad Blue Bull
Member
 
Registered: Jul 2017
Distribution: Slackware 14.2
Posts: 45

Original Poster
Rep: Reputation: Disabled
Ponce: OK, I created some mess with ld.so.conf in drastic attempt to make it working, now I've deleted lines you told, now I have this error when run Java:
Code:
java: error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory
upd:
Code:
% locate libjli.so
/usr/lib64/java/lib/amd64/jli/libjli.so
/usr/lib64/java/jre/lib/amd64/jli/libjli.so
If I add /usr/lib64/java/lib/amd64/jli to ld.so.conf I have "Error: could not find libjava.so" then, if I delete it I have "java: error while loading shared libraries: libjli.so..."

Last edited by Bad Blue Bull; 10-16-2019 at 01:20 PM.
 
Old 10-16-2019, 01:17 PM   #6
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 6,044

Rep: Reputation: Disabled
remove the java package you built and build a new jdk package using the SlackBuild from SBo (download the SlackBuild files from the link I gave you: refer to the howto).
then install the resulting package, logout and login again.
 
Old 10-16-2019, 03:03 PM   #7
Bad Blue Bull
Member
 
Registered: Jul 2017
Distribution: Slackware 14.2
Posts: 45

Original Poster
Rep: Reputation: Disabled
JDK seems to be alright because I can compile helloworld. It's listed by sbopkg -p. The problem seems to be with JRE. I have created a symlink for libjli at /usr/lib64 but now java fails to find libjava.so
Quote:
LD_DEBUG=libs /usr/bin/java -version
17742: find library=libpthread.so.0 [0]; searching
17742: search path=/usr/bin/../lib/amd64/jli/tls/x86_64:/usr/bin/../lib/amd64/jli/tls:/usr/bin/../lib/amd64/jli/x86_64:/usr/bin/../lib/amd64/jli:/usr/bin/../lib/amd64/tls/x86_64:/usr/bin/../lib/amd64/tls:/usr/bin/../lib/amd64/x86_64:/usr/bin/../lib/amd64 (RPATH from file /usr/bin/java)
17742: trying file=/usr/bin/../lib/amd64/jli/tls/x86_64/libpthread.so.0
17742: trying file=/usr/bin/../lib/amd64/jli/tls/libpthread.so.0
17742: trying file=/usr/bin/../lib/amd64/jli/x86_64/libpthread.so.0
17742: trying file=/usr/bin/../lib/amd64/jli/libpthread.so.0
17742: trying file=/usr/bin/../lib/amd64/tls/x86_64/libpthread.so.0
17742: trying file=/usr/bin/../lib/amd64/tls/libpthread.so.0
17742: trying file=/usr/bin/../lib/amd64/x86_64/libpthread.so.0
17742: trying file=/usr/bin/../lib/amd64/libpthread.so.0
17742: search cache=/etc/ld.so.cache
17742: trying file=/lib64/libpthread.so.0
17742:
17742: find library=libjli.so [0]; searching
17742: search cache=/etc/ld.so.cache
17742: search path=/lib64/tls/x86_64:/lib64/tls:/lib64/x86_64:/lib64:/usr/lib64/tls/x86_64:/usr/lib64/tls:/usr/lib64/x86_64:/usr/lib64 (system search path)
17742: trying file=/lib64/tls/x86_64/libjli.so
17742: trying file=/lib64/tls/libjli.so
17742: trying file=/lib64/x86_64/libjli.so
17742: trying file=/lib64/libjli.so
17742: trying file=/usr/lib64/tls/x86_64/libjli.so
17742: trying file=/usr/lib64/tls/libjli.so
17742: trying file=/usr/lib64/x86_64/libjli.so
17742: trying file=/usr/lib64/libjli.so
17742:
17742: find library=libdl.so.2 [0]; searching
17742: search cache=/etc/ld.so.cache
17742: trying file=/lib64/libdl.so.2
17742:
17742: find library=libc.so.6 [0]; searching
17742: search cache=/etc/ld.so.cache
17742: trying file=/lib64/libc.so.6
17742:
17742:
17742: calling init: /lib64/libpthread.so.0
17742:
17742:
17742: calling init: /lib64/libc.so.6
17742:
17742:
17742: calling init: /lib64/libdl.so.2
17742:
17742:
17742: calling init: /usr/lib64/libjli.so
17742:
17742:
17742: initialize program: /usr/bin/java
17742:
17742:
17742: transferring control: /usr/bin/java
17742:
Error: could not find libjava.so
Error: Could not find Java SE Runtime Environment.
17742:
17742: calling fini: /usr/bin/java [0]
17742:
17742:
17742: calling fini: /usr/lib64/libjli.so [0]
17742:
17742:
17742: calling fini: /lib64/libpthread.so.0 [0]
17742:
17742:
17742: calling fini: /lib64/libdl.so.2 [0]
17742:
17742:
17742: calling fini: /lib64/libc.so.6 [0]
17742:
 
Old 10-16-2019, 03:24 PM   #8
Bad Blue Bull
Member
 
Registered: Jul 2017
Distribution: Slackware 14.2
Posts: 45

Original Poster
Rep: Reputation: Disabled
OK, it works when I run /usr/lib64/java/bin/java, not /usr/bin/java
 
Old 10-16-2019, 04:17 PM   #9
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,033

Rep: Reputation: 5582Reputation: 5582Reputation: 5582Reputation: 5582Reputation: 5582Reputation: 5582Reputation: 5582Reputation: 5582Reputation: 5582Reputation: 5582Reputation: 5582
Quote:
Originally Posted by Bad Blue Bull View Post
OK, it works when I run /usr/lib64/java/bin/java, not /usr/bin/java
Where did you get a /usr/bin/java? I don't have that on my system at all. The java provided by the jdk should be the /usr/lib64/java/bin/java and once you log out and log back in, it adds that location to your $PATH.
 
Old 10-16-2019, 05:02 PM   #10
Bad Blue Bull
Member
 
Registered: Jul 2017
Distribution: Slackware 14.2
Posts: 45

Original Poster
Rep: Reputation: Disabled
bossmadrigal: I have no idea how it happened. I've just removed /usr/bin/java.
I've found a bug reported in 2003 https://bugs.java.com/bugdatabase/vi...bug_id=4876186 it says not to use hard links and use symlinks if needed.
No idea how a hard link at /usr/bin/java was created. Installing MySQL-Workbench SBopkg downloaded some rubbish instead of JDK and the error was given, I've downloaded JDK from the Oracle's site and placed it at /tmp/SBo/package-jdk or something like that, chose "Retry" and installation went on. Then I've downloaded JRE and installed it with java.SlackBuild

Last edited by Bad Blue Bull; 10-16-2019 at 05:03 PM.
 
Old 10-16-2019, 05:27 PM   #11
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,448

Rep: Reputation: 7692Reputation: 7692Reputation: 7692Reputation: 7692Reputation: 7692Reputation: 7692Reputation: 7692Reputation: 7692Reputation: 7692Reputation: 7692Reputation: 7692
In Freenode ##slackware he told us that his shell is zsh, not bash, which is the likely cause of his issue (JAVA PATH is not getting set for instance).
 
Old 10-16-2019, 05:48 PM   #12
Bad Blue Bull
Member
 
Registered: Jul 2017
Distribution: Slackware 14.2
Posts: 45

Original Poster
Rep: Reputation: Disabled
Alien Bob: zsh has nothing to do with it, I have this in /etc/zprofile:
Code:
# Append any additional sh scripts found in /etc/profile.d/:
for profile_script in /etc/profile.d/*.sh ; do
  if [ -x $profile_script ]; then
    . $profile_script
  fi
done
I have all the variables that /etc/profile.d/jdk.sh attempts to export set in my shell.
The problem occured because there was a hard link to java in /usr/bin/
Also I don't know why I have so many hard links...
Code:
$ whereis java       
java: /usr/lib64/java /usr/share/java /usr/lib64/java/bin/java /usr/lib64/java/jre/bin/java

$ whereis javaws                  
javaws: /usr/bin/javaws /usr/lib64/java/bin/javaws /usr/lib64/java/jre/bin/javaws
Also surprise: java and javaws in /usr/bin/ have uucp as owner.
-rwxr-xr-x 1 uucp 143 8464 Dec 15 2018 /usr/bin/java*

Last edited by Bad Blue Bull; 10-16-2019 at 05:54 PM.
 
Old 10-16-2019, 06:18 PM   #13
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,033

Rep: Reputation: 5582Reputation: 5582Reputation: 5582Reputation: 5582Reputation: 5582Reputation: 5582Reputation: 5582Reputation: 5582Reputation: 5582Reputation: 5582Reputation: 5582
It might be worth looking through your package database to see if there's any reference to usr/bin/java in there:

Code:
grep usr/bin/java /var/log/packages/*
That might tell you what package, if any, added that there.
 
Old 10-17-2019, 02:19 AM   #14
Bad Blue Bull
Member
 
Registered: Jul 2017
Distribution: Slackware 14.2
Posts: 45

Original Poster
Rep: Reputation: Disabled
bassmadrigal: no results
 
Old 10-17-2019, 02:29 AM   #15
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 6,044

Rep: Reputation: Disabled
Quote:
Originally Posted by Bad Blue Bull View Post
Installing MySQL-Workbench SBopkg downloaded some rubbish instead of JDK and the error was given, I've downloaded JDK from the Oracle's site and placed it at /tmp/SBo/package-jdk or something like that, chose "Retry" and installation went on. Then I've downloaded JRE and installed it with java.SlackBuild
in the link on SBo I posted you earlier is written that JRE is packaged together with the jdk SlackBuild on SBo: why have you installed two different java versions?

that's why I asked you to remove the java stuff you have installed and just install jdk from SBo.

remember that, also if you are using sbopkg, you *have to* read the READMEs of the stuff you install from SBo.
 
  


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
Problems installing java 1.3.1_07: Can't find libjava.so neocookie Linux - Software 3 08-04-2008 02:24 PM
Error: can't find libjava.so in AIX shipon_97 AIX 1 04-30-2007 11:41 AM
Trouble Invoking JVM From C: Cannot Find libjava.so. eric.r.turner Programming 0 10-20-2003 10:36 PM
Java jre-1.3.1_02 can't find libjava.so after install rhammack Linux - Software 0 01-17-2002 09:39 PM
libjava.so not found! Gladiator Linux - General 3 12-05-2001 02:11 AM

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

All times are GMT -5. The time now is 04:18 AM.

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
Open Source Consulting | Domain Registration