FedoraForum.org - Fedora Support Forums and Community
Results 1 to 11 of 11
  1. #1
    Join Date
    Jan 2013
    Location
    England
    Posts
    4

    Need help with JDK installation, Libjava.so Cannot Be Found

    A while back, openJDK was removed from this computer, which is running Fedora 15 64bit.
    Recently, I have received the computer and wish to go back to programming in java. So I Installed Sun (Oracle) JDK 7. There were no errors with the installation, but it didn't work. That is to say the files are there, but it just threw errors when I tried to run it, specifically libjli.so cannot be found. Worse still, my JRE was no longer working, it threw the same error.

    I searched the internet, and installed and reinstalled JDK and openJDK, resulting in several installations of java, which may be part of the problem, but nothing worked.
    Eventually I used symbolic links to remove the error, which was then replaced by
    Code:
    Error: could not find libjava.so
    Error: Could not find Java SE Runtime Environment.
    Alas, symbolic links did nothing to change this error, and I have tried everything I have found on the internet, to no effect.

    Here are the results of some terminal tests:
    Code:
    [NIH@DAMSON Documents]$ java -- version
    Error: could not find libjava.so
    Error: Could not find Java SE Runtime Environment.
    [NIH@DAMSON Documents]$ sudo alternatives --config java
    [sudo] password for NIH: 
    
    There is 5 program that provides 'java'.
    
      Selection    Command
    -----------------------------------------------
       1           /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java
       2           /usr/lib/jvm/jre-1.5.0-gcj/bin/java
     + 3           /usr/java/jdk1.7.0_10/bin/java
    *  4           /usr/java/jdk1.7.0_10/jre/bin/java
       5           /usr/java/default/bin/java
    
    Enter to keep the current selection[+], or type selection number: 
    [NIH@DAMSON Documents]$ ls -l $(locate libjli.so)
    ^[[A-rwxr-xr-x 1 NIH  NIH  102674 Jun 27  2011 /home/NIH/Downloads/jdk1.7.0/jre/lib/amd64/jli/libjli.so
    -rwxr-xr-x 1 NIH  NIH   48335 Nov 12  2010 /home/NIH/Java/Other/jre1.6.0_23/lib/amd64/jli/libjli.so
    -rwxr-xr-x 1 NIH  NIH   87748 Jun 27  2011 /home/NIH/jdk1.7.0/jre/lib/i386/jli/libjli.so
    -rwxr-xr-x 1 NIH  NIH   38142 Nov 12  2010 /home/NIH/.local/share/Trash/files/jre1.6.0_23/lib/i386/jli/libjli.so
    -rwxr-xr-x 1 root root  50607 Nov 12  2010 /usr/bin/jre1.6.0_23/lib/amd64/jli/libjli.so
    -rwxr-xr-x 1 root root 105728 Nov 28 12:03 /usr/java/jdk1.7.0_10/jre/lib/amd64/jli/libjli.so
    -rwxr-xr-x 1 root root  87748 Jan  9 00:08 /usr/lib/java-1.7.0/libjli.so
    -rwxr-xr-x 1 root root  18104 Jun 13  2012 /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/amd64/jli/libjli.so
    lrwxrwxrwx 1 root root     46 Jan  9 00:10 /usr/lib/libjli.so -> /usr/local/jdk1.7.0/jre/lib/i386/jli/libjli.so
    -rwxr-xr-x 1 root root  87748 Jun 27  2011 /usr/local/jdk1.7.0/jre/lib/i386/jli/libjli.so
    [NIH@DAMSON Documents]$ ls -l $(locate libjava.so)
    -rwxr-xr-x 1 NIH  NIH  219715 Jun 27  2011 /home/NIH/Downloads/jdk1.7.0/jre/lib/amd64/libjava.so
    -rwxr-xr-x 1 NIH  NIH  234388 Nov 12  2010 /home/NIH/Java/Other/jre1.6.0_23/lib/amd64/libjava.so
    -rwxr-xr-x 1 NIH  NIH  182794 Jun 27  2011 /home/NIH/jdk1.7.0/jre/lib/i386/libjava.so
    -rwxr-xr-x 1 NIH  NIH  189012 Nov 12  2010 /home/NIH/.local/share/Trash/files/jre1.6.0_23/lib/i386/libjava.so
    -rwxr-xr-x 1 root root 234388 Nov 12  2010 /usr/bin/jre1.6.0_23/lib/amd64/libjava.so
    -rwxr-xr-x 1 root root 219872 Nov 28 12:03 /usr/java/jdk1.7.0_10/jre/lib/amd64/libjava.so
    -rwxr-xr-x 1 root root 191824 Jun 13  2012 /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/amd64/libjava.so
    lrwxrwxrwx 1 root root     43 Jan  9 00:12 /usr/lib/libjava.so -> /usr/local/jdk1.7.0/jre/lib/i386/libjava.so
    -rwxr-xr-x 1 root root 182794 Jun 27  2011 /usr/local/jdk1.7.0/jre/lib/i386/libjava.so
    [NIH@DAMSON Documents]$ $JAVA_HOME
    bash: /usr/java/jdk1.7.0_10: Is a directory


    If possible please explain from basics. Although I have been using linux for a long time, my dad normally handled installations. But now I'm at uni, so there's no help on that front.
    Last edited by Alpvax; 12th January 2013 at 04:13 AM. Reason: forgot to test JAVA_HOME

  2. #2
    Join Date
    Jun 2004
    Location
    Maryland, US
    Posts
    7,215

    Re: Need help with JDK installation, Libjava.so Cannot Be Found

    java -- version
    is typed incorrectly, it should be:


    java -version


    or "java(space)(single dash)(version)"

  3. #3
    Join Date
    Jan 2013
    Location
    England
    Posts
    4

    Re: Need help with JDK installation, Libjava.so Cannot Be Found

    Quote Originally Posted by marko
    is typed incorrectly, it should be:


    java -version


    or "java(space)(single dash)(version)"

    Thanks, but still no luck, it was a typo, same error appears when -version is used

  4. #4
    Join Date
    Jun 2004
    Location
    Maryland, US
    Posts
    7,215

    Re: Need help with JDK installation, Libjava.so Cannot Be Found

    Can you post the results from a terminal of:

    which java


    alternatives --display java | grep -v "slave"


    /usr/java/default/bin/java -version

  5. #5
    Join Date
    Jan 2013
    Location
    England
    Posts
    4

    Re: Need help with JDK installation, Libjava.so Cannot Be Found

    Code:
    [NIH@DAMSON ~]$ which java
    /usr/local/bin/java
    [NIH@DAMSON ~]$ alternatives --display java | grep -v "slave"
    java - status is manual.
     link currently points to /usr/java/jdk1.7.0_10/bin/java
    /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java - priority 16000
    /usr/lib/jvm/jre-1.5.0-gcj/bin/java - priority 1500
    /usr/java/jdk1.7.0_10/bin/java - priority 2
    /usr/java/jdk1.7.0_10/jre/bin/java - priority 20000
    /usr/java/default/bin/java - priority 20000
    Current `best' version is /usr/java/jdk1.7.0_10/jre/bin/java.
    [NIH@DAMSON ~]$ /usr/java/default/bin/java -version
    java version "1.7.0_10"
    Java(TM) SE Runtime Environment (build 1.7.0_10-b18)
    Java HotSpot(TM) 64-Bit Server VM (build 23.6-b04, mixed mode)

  6. #6
    Join Date
    Jun 2004
    Location
    Maryland, US
    Posts
    7,215

    Re: Need help with JDK installation, Libjava.so Cannot Be Found

    The result from 'which java' shows that your path leads to 'java' being in /usr/local/bin and it shouldn't do that

    The problem is that the alternatives system modifies /usr/bin/java

    For example, /usr/bin/java should be a link to /etc/alternatives/java
    ls -l /usr/bin/java

    lrwxrwxrwx. 1 root root 22 2013-01-11 01:12 /usr/bin/java -> /etc/alternatives/java
    Take a look in /usr/local/bin and see what that java file in there is. Either delete it or if you don't use any commands or applications from /usr/local/bin, then remove /usr/local/bin from your PATH

    also post for me what this shows:
    /usr/local/bin/java -version

  7. #7
    Join Date
    Jan 2010
    Posts
    7,232

    Re: Need help with JDK installation, Libjava.so Cannot Be Found

    I've always found the mjmwired.net guide useful for java.
    http://www.mjmwired.net/resources/mj...-f15.html#java

    is for F15.

    Try running alternatives as he suggests and see if that works.

  8. #8
    Join Date
    Jun 2004
    Location
    Maryland, US
    Posts
    7,215

    Re: Need help with JDK installation, Libjava.so Cannot Be Found

    Try running alternatives as he suggests and see if that works.
    The alternatives --display java result shows correct in his post #5 as:
    Code:
    java - status is manual.
         link currently points to /usr/java/jdk1.7.0_10/bin/java
    My best guess is that the PATH points to java in /usr/local/bin but that Java is broken somehow. So fixing the bad java in /usr/local/ would help and the PATH should be
    fixed so /usr/bin/java is found first

    It would probably be a good idea to remove any bogus JDKs related to these directories (below) too if you're not using them. Having ton's of JDKs and JREs laying around is bad for administration:
    /home/NIH/Downloads/jdk1.7.0
    /home/NIH/Java/Other/jre1.6.0_23
    /home/NIH/jdk1.7.0
    /usr/bin/jre1.6.0_23
    /usr/lib/java-1.7.0
    /usr/local/jdk1.7.0
    /home/NIH/Downloads/jdk1.7.0
    /home/NIH/Java/Other/jre1.6.0_23
    /home/NIH/jdk1.7.0
    /home/NIH/.local/share/Trash/files/jre1.6.0_23/lib/i386/libjava.so
    /usr/bin/jre1.6.0_23
    /usr/local/jdk1.7.0
    Last edited by marko; 13th January 2013 at 03:05 AM.

  9. #9
    Join Date
    Jan 2010
    Posts
    7,232

    Re: Need help with JDK installation, Libjava.so Cannot Be Found

    Sorry, I meant try running the alternatives command suggested on mjmwired's site,
    Code:
    sudo /usr/sbin/alternatives --install /usr/lib/mozilla/plugins/libjavaplugin.so \
    libjavaplugin.so /usr/java/default/lib/i386/libnpjp2.so 20000
    (For 32 bit, explained in more detail at the link I gave--additional info for 64 bit and using it as mozilla plugin)

  10. #10
    Join Date
    Jun 2004
    Location
    Maryland, US
    Posts
    7,215

    Re: Need help with JDK installation, Libjava.so Cannot Be Found

    Quote Originally Posted by smr54
    Sorry, I meant try running the alternatives command suggested on mjmwired's site,
    Code:
    sudo /usr/sbin/alternatives --install /usr/lib/mozilla/plugins/libjavaplugin.so \
    libjavaplugin.so /usr/java/default/lib/i386/libnpjp2.so 20000
    (For 32 bit, explained in more detail at the link I gave--additional info for 64 bit and using it as mozilla plugin)
    That's what you need for the browser java plugin to work. The browser java plugin has nothing to do with his problem, he wants JDK programming support

  11. #11
    Join Date
    Jan 2013
    Location
    England
    Posts
    4

    Re: Need help with JDK installation, Libjava.so Cannot Be Found

    Quote Originally Posted by marko
    The result from 'which java' shows that your path leads to 'java' being in /usr/local/bin and it shouldn't do that

    The problem is that the alternatives system modifies /usr/bin/java

    For example, /usr/bin/java should be a link to /etc/alternatives/java
    Take a look in /usr/local/bin and see what that java file in there is. Either delete it or if you don't use any commands or applications from /usr/local/bin, then remove /usr/local/bin from your PATH

    also post for me what this shows:
    Code:
    [NIH@DAMSON ~]$ ls -l /usr/bin/java
    lrwxrwxrwx 1 root root 22 Jan 12 03:05 /usr/bin/java -> /etc/alternatives/java
    [NIH@DAMSON ~]$ /usr/local/bin/java -version
    Error: could not find libjava.so
    Error: Could not find Java SE Runtime Environment.
    and after deleting files:
    Code:
    [NIH@DAMSON ~]$ /usr/local/bin/java -version
    bash: /usr/local/bin/java: No such file or directory


    ---------- Post added at 06:50 AM ---------- Previous post was at 06:49 AM ----------

    Code:
    [NIH@DAMSON ~]$ alternatives --display java | grep -v "slave"
    java - status is manual.
     link currently points to /usr/java/jdk1.7.0_10/bin/java
    /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java - priority 16000
    /usr/lib/jvm/jre-1.5.0-gcj/bin/java - priority 1500
    /usr/java/jdk1.7.0_10/bin/java - priority 2
    /usr/java/jdk1.7.0_10/jre/bin/java - priority 20000
    /usr/java/default/bin/java - priority 20000
    Current `best' version is /usr/java/jdk1.7.0_10/jre/bin/java.
    [NIH@DAMSON ~]$ which java
    /usr/bin/java
    [NIH@DAMSON ~]$ java -version
    java version "1.7.0_10"
    Java(TM) SE Runtime Environment (build 1.7.0_10-b18)
    Java HotSpot(TM) 64-Bit Server VM (build 23.6-b04, mixed mode)
    That seemed to be the problem, thanks

    ---------- Post added at 07:07 AM ---------- Previous post was at 06:50 AM ----------

    Thanks guys, it seems the problem was having it in /usr/local/bin, it now seems to work perfectly

Similar Threads

  1. Java libjava.so cannot be found
    By Peter_APIIT in forum Using Fedora
    Replies: 4
    Last Post: 27th December 2010, 01:05 PM
  2. F12: Installation image not found error, DVD ISO installation
    By trancefreak in forum Installation, Upgrades and Live Media
    Replies: 1
    Last Post: 21st April 2010, 03:41 PM
  3. Replies: 0
    Last Post: 9th January 2007, 09:59 AM
  4. CD Not found During Installation! :(
    By Gomez in forum Installation, Upgrades and Live Media
    Replies: 4
    Last Post: 29th December 2004, 05:39 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •