2
I’m setting up JAVA and ANT on Linux Server, following a few steps I found on the internet, because I’ve never done this on Linux. I set them up by the terminal because I’m accessing the machine through the SSH. I’m setting it up this way:
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 I am configuring is 1.6.0_05.
and when I make the following command
javac -version
the version that appears is
javac 1.6.0_05
I wonder why when I give a java -version is not the version 1.6.0_05 that appears.
PS: Don’t worry about the java version, I’m doing some tests and I was trying to configure the previous java anyway
On debian systems has a bid of java alterantives... Give a search on this. It is for you to switch between versions of Java and choose a default, if I am not mistaken.
– igventurelli
If you want to force the path choose the desired order:
export PATH=$ANT_HOME/bin:$PATH
– JJoao
@Jjoao It worked what you said, interesting, I thought doing the
export PATH=${PATH}:${JAVA_HOME}/bin
I put it in front.– Guilherme Oliveira
@Igorventurelli thanks for the tip, I took a brief look seems to be interesting
– Guilherme Oliveira
To know which java is being called:
which java
– Piovezan