Java configuration in fedora linux

2

I'm configuring JAVA and ANT in linux fedora, following a few steps I found on the internet, because I've never done that in linux. I configure them by the terminal because I am accessing the machine through SSH. I'm configuring it as follows:

export ANT_HOME=/root/Desktop/apache-ant/apache-ant-1.7.1

export JAVA_HOME=/root/bea/jdk160_05

export PATH=${PATH}:${ANT_HOME}/bin

export PATH=${PATH}:${JAVA_HOME}/bin

export CLASSPATH=.:$JAVA_HOME/bin

But when I do

java -version

appears

java version "1.7.0_51"
OpenJDK Runtime Environment (fedora-2.4.4.1.fc20-x86_64 u51-b02)
OpenJDK 64-Bit Server VM (build 24.45-b08, mixed mode)

The java that I'm configuring is 1.6.0_05.

and when I do the following command

javac -version

The version that appears is

javac 1.6.0_05

I would like to know why when I give a java -version it's not version 1.6.0_05 that appears.

PS: Do not worry about the java version, I'm doing some tests and was trying to configure the previous java even

    
asked by anonymous 04.09.2017 / 20:01

1 answer

0
  • Remove OpenJDK.
  • Download the JDK from the Oracle website and unzip the package to your preferred folder, in my case I use / usr / local / java.
  • use update-alternatives to configure the executable, as in the following example:
    sudo update-alternatives --install "/usr/bin/java" "java" "caminho_do_jdk/bin/java" 1
  • repeat the operation for javac and javaws.
  • Create and export your JAVA_HOME into your terminal configuration file (bashrc, zshrc etc).
  • 13.04.2018 / 18:48