Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I just installed Fedora 17. I'm setting up the Android Build Environment and need Java.

I downloaded and installed jdk-6u32-linux-amd64.rpm I ran

java -version

and it spit out the correct version.

Well a day or two later i tried my first compile in Fedora 17 and it complained about java and failed. I ran java -version again and low and behold it spits out

$ java -version
java version "1.7.0_03-icedtea"
OpenJDK Runtime Environment (fedora-2.1.fc17.7-x86_64)
OpenJDK 64-Bit Server VM (build 22.0-b10, mixed mode)

I'm stumped. I mean, i've run the update/upgrade commands since i installed but i didn't think that updated full version revisions... So, I ran

alternatives --config java

and that only gave me the java 1.7 version.

While digging around more I discovered that the recommended version of Java for the build environment is jdk-6u27-linux-x64-rpm.bin so I downloaded that from here: Oracle Download

When I ran:

sudo sh jdk-6u27-linux-x64-rpm.bin

it returned:

Unpacking...
Checksumming...
Extracting...
UnZipSFX 5.50 of 17 February 2002, by Info-ZIP (Zip-Bugs@lists.wku.edu).
  inflating: jdk-6u27-linux-amd64.rpm  
  inflating: sun-javadb-common-10.6.2-1.1.i386.rpm  
  inflating: sun-javadb-core-10.6.2-1.1.i386.rpm  
  inflating: sun-javadb-client-10.6.2-1.1.i386.rpm  
  inflating: sun-javadb-demo-10.6.2-1.1.i386.rpm  
  inflating: sun-javadb-docs-10.6.2-1.1.i386.rpm  
  inflating: sun-javadb-javadoc-10.6.2-1.1.i386.rpm  
Preparing...                ########################################### [100%]
    package jdk-2000:1.6.0_32-fcs.x86_64 (which is newer than jdk-2000:1.6.0_27-fcs.x86_64) is already installed

Done.

so now I'm confused. I ran:

alternatives --config java

again but it's still only returning 1.7 so I don't know what to do.I want to end up with 6u27 as the installed and functional version of the JDK. Thank you.

share|improve this question

migrated from stackoverflow.com Jun 16 '12 at 1:02

This question came from our site for professional and enthusiast programmers.

2 Answers 2

After you unpack the linux bin, You have to let system know.

alternatives --install /usr/bin/java java /path/to/your/java 10

then you can config it with

alternatives --config java

share|improve this answer

put 6u27 in your path in stead of the 1.7 version and should be ok,or just run your applciation with the jre in your 6u27 installation in stead of using the one in your path

you can install several version, just make sure you run with the correct one

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.