Results 1 to 6 of 6

Thread: Java error - "could not find Java 2 Runtime Environment"

  1. #1
    Join Date
    May 2009
    Beans
    11

    Question Java error - "could not find Java 2 Runtime Environment"

    I've been trying to run a jar file with "java -jar <jarfile path>, and it keeps giving me this error:

    Error: could not find libjava.so
    Error: could not find Java 2 Runtime Environment.


    Note: libjava.so exists and is located at the following:

    /usr/lib/jvm/java-6-openjdk/jre/lib/i386/libjava.so
    /usr/lib/jvm/java-6-sun-1.6.0.16/jre/lib/i386/libjava.so

    I've even tried copying libjava.so to /lib and still nothing.

    I've tried reinstalling the java6-sdk and jre packages and it still didn't work. Any ideas? Thanks!

  2. #2
    Join Date
    Apr 2006
    Location
    Timisoara, Romania
    Beans
    132
    Distro
    Ubuntu 11.10 Oneiric Ocelot

    Re: Java error - "could not find Java 2 Runtime Environment"

    Hi.

    What is your default java executable?
    Try to type this in terminal:
    $which java

    What is the output?
    Bogdan

  3. #3
    Join Date
    May 2009
    Beans
    11

    Re: Java error - "could not find Java 2 Runtime Environment"

    $ which java
    /usr/bin/java

    "ls -l /usr/bin/java" tells me that it isn't a link.

    Thanks!

  4. #4
    Join Date
    Apr 2006
    Location
    Timisoara, Romania
    Beans
    132
    Distro
    Ubuntu 11.10 Oneiric Ocelot

    Re: Java error - "could not find Java 2 Runtime Environment"

    Hi.
    It looks to me that the default java executable in your system is not sun's jdk.
    What is the output of java --version?
    How did you install sun jdk/jre? Via ubuntu repos?

    Bogdan

  5. #5
    credobyte is offline Iced Blended Vanilla Crème Ubuntu
    Join Date
    Jun 2009
    Beans
    1,559
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: Java error - "could not find Java 2 Runtime Environment"

    Code:
    sudo update-java-alternatives -s java-6-sun

  6. #6
    Join Date
    May 2009
    Beans
    11

    Re: Java error - "could not find Java 2 Runtime Environment"

    $ java --version
    Error: could not find libjava.so
    Error: could not find Java 2 Runtime Environment.

    Yes, i got my java from the Ubuntu repos by doing:
    sudo apt-get install sun-java6-jdk sun-java6-jre


    tries this:

    sudo update-java-alternatives -s java-6-sun no difference. thanks, though.

Tags for this Thread

Bookmarks

Posting Permissions

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