Announcement

Collapse
No announcement yet.

Java linked to /usr/bin but can't run java without specifying full path

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Java linked to /usr/bin but can't run java without specifying full path

    Hi,

    Really weird problem here.

    A while ago, I installed Java 6 under Feisty Fawn using the package from Sun. I just upgraded to gutsy gibbon.

    If I type "java" at the command prompt I get the following error:

    Code:
    The program 'java' can be found in the following packages:
     * j2re1.4
     * kaffe
     * cacao
     * java-gcj-compat
     * gij-4.1
     * jamvm
     * gij-4.2
     * sablevm
    Try: sudo apt-get install <selected package>
    bash: java: command not found
    But, if I search the adept package manager for "java6" it says that java is installed.

    And I have links to /usr/lib/jvm/java-6-sun/bin/java in /usr/bin.

    And if I specify the absolute path to /usr/bin/java it works.

    How can I get the error message to dissapear?

    Thanks,

    Dan

    #2
    Re: Java linked to /usr/bin but can't run java without specifying full path

    Try reinstalling the Java6 package and see if that helps any; it's probably just a minor but.
    Asus G1S-X3:
    Intel Core2 Duo T7500, Nvidia GeForce 8600M GT, 4Gb PC2-5300, 320Gb Hitachi 7k320, Linux ( )

    Comment


      #3
      Re: Java linked to /usr/bin but can't run java without specifying full path

      Not sure if this will help but it maybe that there is just no defaul set within kubuntu, try running: sudo update-java-alternatives --list
      Which should list your current java installations. Lets assume your output is: ia32-java-6-sun 63 /usr/lib/jvm/ia32-java-6-sun
      Then you just need to run: sudo update-java-alternatives --set ia32-java-6-sun

      Comment


        #4
        Re: Java linked to /usr/bin but can't run java without specifying full path

        I managed to fix Java by deleting the link to /usr/bin and relinking it.

        Weird, huh?

        Comment

        Working...
        X