Results 1 to 5 of 5

Thread: How to set Java ?

  1. #1

    Smile How to set Java ?

    Good day!
    I going to launch Android Studio and install IntelliJ IDEA to my OpenSuse 12.1.
    When I begun to do it I had seen:
    "tools.jar' seems to be not in IDEA classpath. Please ensure JAVA_HOME points to JDK rather than JRE. "
    I changed JAVA_HOME strings in files: /etc/profile.d/alljava.sh and /etc/profile.d/alljava.csh to another path and next message had appeared:
    "OpenJDK 6 is not supported. Please use Oracle Java or newer OpenJDK."
    So, I install JDK 7 from oracle website, but nothing has change, and I changed "alljava" files back, but message still: "OpenJDK 6 is not supported. Please use Oracle Java or newer OpenJDK."

    What I need to do to make it work?
    If somebody can tell how does programs use JDK, and what files is using for set global variables for environment - it will be really great.
    Thnx in advantage.

  2. #2
    Join Date
    May 2012
    Location
    Finland
    Posts
    2,005

    Default Re: How to set Java ?

    openSUSE 12.1 is EOL by the way, you should look at upgrading to 13.1.

    Run (as root):
    update-alternatives --config java

    Does it present you with multiple Java to choose from?
    .: miuku #suse @ irc.freenode.net
    :: miuku@opensuse.org

    .: h​ttps://download.opensuse.org/repositories/home:/Miuku/

  3. #3

    Default Re: How to set Java ?

    Quote Originally Posted by Miuku View Post
    openSUSE 12.1 is EOL by the way, you should look at upgrading to 13.1.

    Run (as root):
    update-alternatives --config java

    Does it present you with multiple Java to choose from?
    It writes that :
    "There is only one alternative in link group java: /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java
    Nothing to configure.
    update-alternatives: warning: forcing reinstallation of alternative /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java because link group java is broken."

  4. #4
    Join Date
    May 2012
    Location
    Finland
    Posts
    2,005

    Default Re: How to set Java ?

    Uninstall everything related to OpenJDK and install the RPM version of Java from java.sun.com (first uninstall it, then install the Oracle's version or it won't upgrade the files properly)

    for example;
    zypper rm "*openjdk*"

    zypper in jre-7u51-linux-x64.rpm

    Tested it in a Virtual Machine and it worked fine;

    aquila:/home/miuku # java -version
    java version "1.7.0_51"
    Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
    Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode)
    .: miuku #suse @ irc.freenode.net
    :: miuku@opensuse.org

    .: h​ttps://download.opensuse.org/repositories/home:/Miuku/

  5. #5
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    11,448
    Blog Entries
    2

    Default Re: How to set Java ?

    If a Java install didn't install into update-alternatives you can
    - As Miuku suggests, uninstall all Java and then install your preferred leaving only the one available for use
    - Go through the update-alternatives MAN pages and add your new Java (The relatively simple command isn't at the top of my head). This gives you the ability two switch between the two Java

    Also,
    Don't forget to remove your modifications to /etc/profile.d/alljava.sh and /etc/profile.d/alljava.csh

    And, in the future if you want to over-ride default settings, the general recommendation (see comments in /etc/profile) is to create a file /etc/profile.local with your changes.

    The general idea is to keep your customizations completely separate from defaults so you can easily return to defaults and if you install an update or upgrade those changes won't over-write your customizations.

    You <can> set your JAVA environmental variables in /etc/profile.local, I've done so in special circumstances.

    TSU

Posting Permissions

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