FedoraForum.org - Fedora Support Forums and Community
Results 1 to 11 of 11
  1. #1
    Join Date
    Oct 2008
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    java not working

    hi,

    I have Fedora 12 and Windows 7 in a dual boot configuration in my lenovo laptop.
    The config of my laptop is core2duo 1.73, 3gb ram and 160gb hdd.

    My java was working properly till now. I used to start JDownloader by using "java -jar JDowloader.jar". But now it is showing "command not found"

    Code:
    [root@electron ~]# java -jar /root/.jd/JDownloader.jar 
    bash: java: command not found
    
    [root@electron ~]# which java
    /usr/bin/which: no java in (/usr/lib/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/lib/ccache:/usr/local/bin:/usr/bin:/bin:/usr/games:/usr/local/sbin:/usr/sbin:/sbin:/opt/real/RealPlayer:/home/livingstone/bin:/opt/real/RealPlayer:/opt/real/RealPlayer)
    
    [root@electron ~]# echo $PATH
    /usr/lib/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/lib/ccache:/usr/local/bin:/usr/bin:/bin:/usr/games:/usr/local/sbin:/usr/sbin:/sbin:/opt/real/RealPlayer:/home/livingstone/bin:/opt/real/RealPlayer:/opt/real/RealPlayer
    
    [root@electron ~]# ls /usr/bin/java -l
    lrwxrwxrwx 1 root root 22 2010-02-27 02:09 /usr/bin/java -> /etc/alternatives/java
    The output of the "ls /usr/bin/java -l" had "/usr/bin/java" in red and "/etc/alternatives/java" in blinking red

    I tried reinstalling java using the following command

    Code:
    yum reinstall java -y
    But the problem persists. Any idea what the problem could be? Should I add anything more to the $PATH variable?

  2. #2
    Join Date
    Sep 2006
    Location
    Connellsville, PA, USA
    Posts
    11,306
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The output of the "ls /usr/bin/java -l" had "/usr/bin/java" in red and "/etc/alternatives/java" in blinking red
    Indicates a busted sym-link. Fix it.

    V

  3. #3
    Join Date
    Oct 2008
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I dont know how to fix the symlink because after few redirections the destination file is not found. I have shown it below. The path in the right side of the "->" was blinking in red

    Code:
    [root@electron ~]# ls -l /usr/bin/java
    lrwxrwxrwx 1 root root 22 2010-02-27 02:09 /usr/bin/java -> /etc/alternatives/java
    [root@electron ~]# ls -l /etc/alternatives/java
    lrwxrwxrwx 1 root root 26 2010-02-27 02:09 /etc/alternatives/java -> /usr/java/default/bin/java
    [root@electron ~]# ls /usr/java/default/bin/java
    ls: cannot access /usr/java/default/bin/java: No such file or directory
    What should I do now?

  4. #4
    PabloTwo's Avatar
    PabloTwo is offline "Fedora User" T-Shirt Winner
    Join Date
    Mar 2007
    Location
    Seville, FL
    Posts
    8,919
    Mentioned
    39 Post(s)
    Tagged
    0 Thread(s)
    Assuming you are using the Fedora 12 provided openjdk java, to reinstall:
    Code:
    yum reinstall java-1.6.0-openjdk

  5. #5
    Join Date
    Sep 2006
    Location
    Connellsville, PA, USA
    Posts
    11,306
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It appears that you had Sun Java installed at one time, and that the alternatives configurator was set to point to it, but now it's missing. Fix the alternatives config (assuming F12 as Paul says) by running (as root-user) the Alternatives Configurator.

    V

  6. #6
    Join Date
    Oct 2008
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you Pablo Two. I already tried "yum reinstall java". The package java-1.6.0-openjdk was reinstalled when I tried the previous command. But the problem persisted.

    Thank you Hlinger. I ran galternatives(GUI frontend for alternatives) and there were multiple entries for java. I changed the one currently selected one for java from "/usr/java/default/bin/java" to "/usr/lib/jvm/jre-1.6.0-openjdk/bin/java". Now java is working.



    Thank you guys for the help. Fedora Forum rocks.
    Attached Images Attached Images

  7. #7
    Join Date
    Dec 2008
    Location
    Brazil
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: java not working

    gilli,

    could you help me providing me more info about how to use this aplication? Nothing I do solve my problem.

    thanks,
    Mateus


    Quote Originally Posted by gilli.livi
    Thank you Pablo Two. I already tried "yum reinstall java". The package java-1.6.0-openjdk was reinstalled when I tried the previous command. But the problem persisted.

    Thank you Hlinger. I ran galternatives(GUI frontend for alternatives) and there were multiple entries for java. I changed the one currently selected one for java from "/usr/java/default/bin/java" to "/usr/lib/jvm/jre-1.6.0-openjdk/bin/java". Now java is working.



    Thank you guys for the help. Fedora Forum rocks.
    Last edited by mmachado; 15th April 2010 at 10:28 PM.

  8. #8
    Join Date
    Oct 2008
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: java not working

    mateus,

    do you have the same problem, i.e, the java binary is not found.
    If so, did u try changing the options in galternatives? If that is not working, post the "ls -l <galternatives entry for java>" output for all the entries for java in galternatives.

    Also this problem got solved, i.e., the links were set straight when i updated fedora

  9. #9
    Join Date
    Dec 2008
    Location
    Brazil
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: java not working

    hi gilli.livi,

    I finnally found the solution out! I was going to reply this!
    Well, It was very simple, although I could not see this before. I read many helps and nothing worked. I updated/reinstalled Java but It seems the solution was ONLY create a symbolic link in /usr/lib/mozilla/plugins/javaplugin_oji.so from the file in /usr/java/jreYOUR_VERSION/lib/i386/libnpjp2.so:

    Creating the symbolic link:

    Code:
    sudo ln -s /usr/java/jre1.6.0_20/lib/i386/libnpjp2.so /usr/lib/mozilla/plugins/javaplugin_oji.so

    This simply solved my problem and It will do for every user. I trying do this in another paths like:
    /usr/lib/firefox/plugins
    /usr/lib/firefox-3.6/plugins
    /home/USER/.mozilla/plugins
    /home/USER/.mozilla/firefox/PROFILE/


    But they didn't work.

    My system operation is Fedora 10, 32bits.


    anyway thank you very much!!!!,
    Mateus

  10. #10
    Join Date
    Sep 2006
    Location
    Connellsville, PA, USA
    Posts
    11,306
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: java not working

    You apparently used the Sun Java self-extracting RPM. In which case the link should be:
    sudo ln -s /usr/java/default/lib/i386/libnpjp2.so /usr/lib/mozilla/plugins/javaplugin_oji.so

    That way, if/when you update Java, the link won't break. /usr/java/default/ is itself an auto-generated link to the latest Java folder in /usr/java/ , created by a %postinstall script in the Java RPMs, exactly for this purpose.

    V

    P.S. Also: you guys missed the 'libjavaplugin.so' alternative item in the Alternatives Configurator (separate item from Java).
    Attached Images Attached Images

  11. #11
    Join Date
    Dec 2008
    Location
    Brazil
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: java not working

    Yeah, I didn't realized this. Better and definitive solution, yours.

    thank you,
    Mateus


    Quote Originally Posted by Hlingler
    You apparently used the Sun Java self-extracting RPM. In which case the link should be:
    sudo ln -s /usr/java/default/lib/i386/libnpjp2.so /usr/lib/mozilla/plugins/javaplugin_oji.so

    That way, if/when you update Java, the link won't break. /usr/java/default/ is itself an auto-generated link to the latest Java folder in /usr/java/ , created by a %postinstall script in the Java RPMs, exactly for this purpose.

    V

Similar Threads

  1. Sun's Java not working/32-bit firefox not working
    By Elektrey in forum Using Fedora
    Replies: 0
    Last Post: 1st August 2008, 08:16 PM
  2. Replies: 6
    Last Post: 27th April 2006, 11:38 AM
  3. Replies: 0
    Last Post: 5th April 2006, 06:50 AM
  4. Replies: 7
    Last Post: 12th March 2006, 07:35 AM
  5. Java not working
    By Thoreau in forum Using Fedora
    Replies: 16
    Last Post: 3rd April 2004, 08:46 AM

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
  •