So I have Java 8 installed on my CentOS 6 machine;

rpm -qa




java -version


java version "1.8.0_161"
Java(TM) SE Runtime Environment (build 1.8.0_161-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.161-b12, mixed mode)

Yet my build file is failing, saying that;

build.xml:223: This build requires Java version 1.8, not 1.6.0_21

From this code:

  <target name="check_versions"
    <fail message="This build requires Java version ${java.version.required}, not ${java.version}."
  <target name="check_java_version">
    <property name="java.version.required" value="1.8"/>
    <condition property="java.version.ok">
        <contains string="${java.version}"

Anyhow, I did something naive. When I went to install Java 8 I of course had to uninstall my old version first. However I could not figure out how the old Java version was installed, or how to uninstall it. There were no installed Java 6 packages recognized by rpm, nor was there anything recognized by yum. As such as I couldn't use rpm or yum to uninstall it. It existed and /home/products, but inside I didn't find any sort of uninstall executable

So, I went brute force simply removed the entire directory (and used rpm to install 8). Now I'm guessing there is something akin to a window's registry still lingering around. How do I fix this issue?

  • 1
    you might strace the build process and see what files it is looking at – thrig Feb 15 '18 at 23:00
  • 2
    What is teh $JAVA_HOME set to? What is your $PATH, and where is the (new) Java located? – ivanivan Feb 15 '18 at 23:31
  • @ivanivna, good call $JAVA_HOME was set to the old directory, now it is set to /usr/bin/java. But for some reason even after fixing that (and SS_JRE_HOME) I'm still having this problem. – danglingPointer Feb 16 '18 at 0:45
  • @thrig I haven't used strace before and it outputs a lot for my build file, what exactly am I looking for? – danglingPointer Feb 16 '18 at 0:45
  • execve calls involving java or other common java binary names or find the fail message and work backwards from that to see what was run. you may need a -s 512 or something to show longer strings containing error messages – thrig Feb 16 '18 at 0:54

It sounds like an that there is still an Java 1.6 version installed on your system. Furthermore environment variables like $JAVA_HOME and $JRE_HOME might be still set to the old directory. There could also be symlinks like /usr/java/latest which are pointing to the former version.

I recommended to start with searching for the installation path of the old version and environment variables. To do so you may use commands like:

sudo find / -name "java"
grep --color -ir "JAVA_HOME\|JRE_HOME" /{etc,opt,var}/*

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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